Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc nodejs #303

Open
timotheecour opened this issue Jun 12, 2020 · 1 comment
Open

misc nodejs #303

timotheecour opened this issue Jun 12, 2020 · 1 comment
Labels

Comments

@timotheecour
Copy link
Owner

timotheecour commented Jun 12, 2020

links

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
It calls requires() on import and make wrapped functions accessible from nim's namespace instead of scoping them into jsobjects.
It can even wrap varargs: https://github.com/alaviss/setup-nim/blob/ng/src/private/path.nim#L14

This should be a good example of how to use npm with nim.

timotheecour added a commit that referenced this issue Feb 9, 2021
* Various changes to `lists` (RFC #303)

* Removing a non-element is no-op; better tests

* Remove preserves cycles; add appendMove alias; tests.

* Return value for (singly linked) `lists.remove`

* More test for lists.remove

* Moved `lists.append` to the end of the file to see all `add` definitions

* Disable testing js for now

* Use workaround for swap js bug

* Smaller diff

* Undo "silent" deprecation of append

* Correct typo in changelog

Co-authored-by: Timothee Cour <[email protected]>

* Remove `appendMoved`

Co-authored-by: Timothee Cour <[email protected]>

* Don't remove appendMoved

Co-authored-by: Clyybber <[email protected]>
Co-authored-by: Timothee Cour <[email protected]>
@timotheecour
Copy link
Owner Author

nim c -b:js main
node --nodearg main.js arg1 arg2
node main.js arg1 arg2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant