Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
unwrap-npm-cmd
Advanced tools
Unwrap npm's node.js bin CMD batch for js files on Windows.
const unwrapNpmCmd = require("unwrap-npm-cmd");
console.log(unwrapNpmCmd("npm test"));
console.log(unwrapNpmCmd("npx mocha", { relative: true }));
console.log(unwrapNpmCmd("mocha test", { jsOnly: true }));
console.log(unwrapNpmCmd(`find "name" package.json`));
console.log(unwrapNpmCmd("hello world", { path: __dirname }));
Output:
"C:\Users\userid\nvm\nodejs\bin\node.exe" "C:\Users\userid\nvm\nodejs\bin\node_modules\npm\bin\npm-cli.js" test
"C:\Users\userid\nvm\nodejs\bin\node.exe" "..\nvm\nodejs\bin\node_modules\npm\bin\npx-cli.js" mocha
"C:\Users\userid\unwrap-npm-cmd\node_modules\mocha\bin\mocha" test
"C:\WINDOWS\system32\find.EXE" "name" package.json
"C:\Users\userid\unwrap-npm-cmd\test\fixtures\hello.CMD" world
child.spawnSync(unwrapNpmCmd("mocha test", { relative: true }));
Would effectivly be doing:
child.spawnSync(
`"C:\\Users\\userid\\nvm\\nodejs\\bin\\node.exe" ".\\node_modules\\mocha\\bin\\_mocha" test`
);
unwrapNpmCmd(cmd, options);
options
:
name | description |
---|---|
path | Use instead of the PATH environment variable. |
jsOnly | Return only the JS file as command without node exe. |
relative | Convert JS file to relative path from CWD. |
cwd | Use instead of process.cwd() to find relative path from. |
Licensed under the Apache License, Version 2.0
FAQs
Unwrap npm's node.js bin CMD batch for js files on Windows
The npm package unwrap-npm-cmd receives a total of 9,284 weekly downloads. As such, unwrap-npm-cmd popularity was classified as popular.
We found that unwrap-npm-cmd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.