POC of using clap in NodeJS apps #3486
jonathanmorley
started this conversation in
Show and tell
Replies: 1 comment
-
What would you need from clap to make this a crate on top of it and Being separate will make it easier to document wasm-specific needs and make it easier to keep the wasm-specific costs to just the wasm support (e.g. we don't want to force a Note that most of the use of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is a POC of using clap in a NodeJS app: https://github.com/clap-rs/clap/compare/master...jonathanmorley:nodejs-wasm?expand=1.
Some comments:
wasm-bindgen
has some limitations in what it expects as exportable objects. Notably, it doesn't allow lifetimes or type parameters, which means that I had to make a couple of functions that acceptedString
s instead ofKey
s.OsString
is not serde serializable outside of unix/windows.forbid_unsafe
is actually not necessary, its only used for the console.log statements.I'm interested in hearing people's thoughts on this idea.
Relevant issues:
Beta Was this translation helpful? Give feedback.
All reactions