Commit activity
Last 12 weeks · 1 commit
Community health
4 of 6 standards met
Recent PRs & issues
On Windows, nano-spawn escapes every argument to a or file twice, so that a batch file that passes them on, like a shim, still gets special characters through (#38). A batch file that reads an argument itself sees the second layer of escaping instead. The launchers Gradle generates for Java programs read their first argument with , so they fail on any argument: Those are the Android SDK's and , which an open React Native Harness PR runs through nano-spawn to support Windows (callstackincubator/react-native-harness#192). I have a fix with tests on my fork, since pull requests here are open to collaborators only: https://github.com/sindresorhus/nano-spawn/compare/main...YevheniiKotyrlo:nano-spawn:fix/escape-batch-arguments-once. An argument without special characters needs no escaping, so it is passed as is, or only quoted when it is empty or holds whitespace, which every batch file reads correctly; an argument with special characters is escaped twice as before, so #38's cases are unchanged. A batch file that reads a first argument containing special characters still fails, since no single escaping serves both kinds of batch file there. reproduces the launcher's header, and the new tests pass a plain argument, one with , one with a space and one ending in through it; on they fail with the errors above. On Windows 11 the full suite passes on the branch apart from three cases that fail on too on that machine: they run Node with , and its path there, under , holds a space. With the change, the and calls above and with on stdin exit 0.
Recent fixes
Fixes #112. Arbitrary strings passed to are now used directly as subprocess input. The four Node.js stdio modes (, , , and ) keep their existing behavior, and the existing form remains supported. The implementation only applies this shorthand to the top-level option, so , , and continue to follow Node.js semantics. Includes runtime tests for arbitrary and empty strings, the commonly mistyped value, the correct mode, TypeScript coverage, and documentation updates.
Repository: sindresorhus/nano-spawn. Description: Tiny process execution for humans — a better child_process Stars: 592, Forks: 16. Primary language: JavaScript. Languages: JavaScript (92.7%), TypeScript (7.3%). License: MIT. Latest release: v2.1.0 (6mo ago). Open PRs: 0, open issues: 4. Last activity: 1mo ago. Community health: 85%. Top contributors: ehmicky, sindresorhus, fisker, Septh.