Imported from yannelli/pi-rust (
crates/pi-js/AGENTS.md). Install upstream withnpx skills add yannelli/pi-rust --skill pi-js. Copyright stays with the author.
pi-js rules
pi-js runs pi extensions on QuickJS with Node 22 built-in modules. Read docs/agents/node-compat.md before you change it.
- Match Node 22: return values, error codes, error messages, and event order. Compare with real Node output in tests.
- Keep
src/unsupported.rstrue. Remove or reword an entry in the change that closes it, and add one for any behavior you leave partial. - A module is native code in
src/node/<module>.rsplus JavaScript insrc/js/<module>.js. Keep each new file under 480 lines. - Tests use localhost and temp dirs only. Wrap scripts that could hang in
run_cjs_withinand mark progress in astagefile. cfg(windows)code must cross-build:cargo zigbuild --target x86_64-pc-windows-gnu -p pi-js --tests.
