Tracking issue: https://github.com/nodejs/tooling/issues/74
We voted on these topics (as per the x's).
package.json
scripts with node (e.g., node --require-module=rmdir -rf foo.js
). xxxxxexecvp
xcpFile
(copy recursive). xxxxIan: how would this work?
Chris: Node.js ships with some lightweight executable scripts that wrap useful builtin functions, e.g., rmdir mkdir
Tobias: you could use node -e \”fs.rmdir()\”
Ben: node -e
is gross
Ian: I still use userland rimraf because I need the binlink even though it’s available in fs with recursive option. Seems silly
Ben: good for those new to Node.js
Tobias: a standard interface for calling a node builtin function with a syntax for specifying arguments
Bryan gives example: node -c fs mkdir recursive:true /foo/bar/mydir
Ian/Ben: ties into command-line argument parsing; if we had the arg parser it’d help get this done
Tobias: this would be useful because I am a Windows user and people put linux nonsense in the package.json
scripts
Ben: a minimal command-line argument parser
(comment): There are many different ways to parse arguments, there’s no standard, etc.
Chris: There’s a set of features common to most every command-line tool in the node ecosystem; this common set is what we focus on
Ian: we have made some other fs functions “recursive” e.g., mkdir and rmdir, but being able to copy a file tree would be great
Bryan: might be tricky since fs.cpFile does not take an option. Maybe new function?
Bryan: there’s a lot of options for including native code in Node.js. NAPI, old style.
Michael: we discussed FFI during NAPI effort
Bryan: when you provide a function to the V8 “fast api calls” api you must provide the “fast” implementation and the “slow” implementation as well. You don’t get it for free
Michael: can we make an API that auto-generates code and makes the adapter for you
Bryan: here are some experiments on this front: https://github.com/bengl/sbffi (the tcc branch is the closest to what I’m proposing, but the shared buffer part isn’t important)
Ben: we should get this on the agenda
Michael: may want to pull some NAPI team members
We have a meeting every two weeks, please join: https://github.com/nodejs/tooling