Hopefully you find this useful: https://github.com/alaviss/setup-nim/blob/ng/src/private/utils.nim#L145
It's a node wrapping macro I made for wrapping Github Actions' toolkit, see how to use here: https://github.com/alaviss/setup-nim/blob/ng/src/private/actions/core.nim#L34
https://github.com/alaviss/setup-nim/tree/ng
This should be a good example of how to use npm with nim.