1.2.0 • Published 3 years ago
install-scripts v1.2.0
install-scripts
This package is to disclose scripts running on npm install
.
npm install --save-dev install-scripts
CLI
# install dependencies without running scripts
% npm install --ignore-scripts
% npx install-scripts
fsevents
scripts:
install: node install
paths:
node_modules/fsevents/package.json
puppeteer
scripts:
install: node install.js
paths:
node_modules/puppeteer/package.json
styled-components
scripts:
postinstall: node ./scripts/postinstall.js || exit 0
paths:
node_modules/styled-components/package.json
// or
% npx install-scripts path/to/project/node_modules
Node API
const installScripts = require("install-scripts");
(async () => {
const result = await installScripts(target);
Object.values(result).forEach(({ paths, scripts, name}) => {
console.log(name, scripts, paths);
});
})();