We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
n/a
import runScript from '@npmcli/run-script'; (async () => { let path = 'xxxx\\test\\res\\pkg-a'; await runScript({ event: 'pretest', path, stdioString: true, stdio: 'inherit', }) .then((ret) => { console.dir(ret) }) .catch((e) => { console.trace(e) }) ; await runScript({ event: 'test', path, stdioString: true, stdio: 'inherit', }) .then((ret) => { console.dir(ret) }) .catch((e) => { console.trace(e) }) ; })();
{ "name": "pkg-a", "scripts": { "pretest": "echo pretest && npm init", "test": "echo test", } }
when npm init is ask input send a ctrl + c ending it
ctrl + c
> pkg-a@1.0.0 pretest > echo pretest && npm init pretest This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See `npm help json` for definitive documentation on these fields and exactly what they do. Use `npm install <pkg>` afterwards to install a package and save it as a dependency in the package.json file. Press ^C at any time to quit. package name: (pkg-a) npm WARN init canceled { cmd: 'C:\\WINDOWS\\system32\\cmd.exe', args: [ '/d', '/s', '/c', '"echo pretest && npm init"' ], code: 0, signal: null, stdout: '', stderr: '', event: 'pretest', script: 'echo pretest && npm init', pkgid: '[email protected]', path: 'test\\res\\pkg-a' } > pkg-a@1.0.0 test > echo test test { cmd: 'C:\\WINDOWS\\system32\\cmd.exe', args: [ '/d', '/s', '/c', '"echo test"' ], code: 0, signal: null, stdout: '', stderr: '', event: 'test', script: 'echo test', pkgid: '[email protected]', path: 'test\\res\\pkg-a' }
can know user is send ctrl + c from return message
The text was updated successfully, but these errors were encountered:
The plan (discussed in npm/cli#2124) is to proxy signals to and from child processes when run in foreground mode (ie, stdio: 'inherit').
stdio: 'inherit'
Sorry, something went wrong.
No branches or pull requests
What / Why
When
Where
How
when npm init is ask input
send a
ctrl + c
ending itCurrent Behavior
Expected Behavior
can know user is send ctrl + c from return message
Who
References
The text was updated successfully, but these errors were encountered: