npm scripts hooks All In One
npm scripts hooks All In One
npm install hooks
npm postinstall
https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-install
https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-ci
https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-rebuild
{
"scripts" : {
"install" : "scripts/install.js",
"postinstall" : "scripts/install.js",
"uninstall" : "scripts/uninstall.js"
}
}
https://docs.npmjs.com/cli/v9/using-npm/scripts#examples
???
https://www.npmjs.com/package/postinstall
https://github.com/kapouer/postinstall
demos
npm install hooks
preinstall
install
postinstall
prepublish
preprepare
prepare
postprepare
https://docs.npmjs.com/cli/v9/using-npm/scripts#npm-install
chmod +x / chmod 755
# chmod +x
$ chmod +x ./scripts/preinstall.sh
$ chmod +x ./scripts/install.sh
$ chmod +x ./scripts/postinstall.sh
$ chmod +x ./scripts/prepublish.sh
$ chmod +x ./scripts/preprepare.sh
$ chmod +x ./scripts/prepare.sh
$ chmod +x ./scripts/postprepare.sh
# 批量 folder
# $ chmod +x ./scripts/
$ chmod +x ./scripts/*.*
https://github.com/web-fullstack/patch-package-in-action/blob/main/npm-hooks/package.json
patch-package
package.json
{
// ...
"scripts": {
"postinstall": "patch-package"
}
// ...
}
https://github.com/web-fullstack/patch-package-in-action/blob/main/package.json
https://www.npmjs.com/package/patch-package#why-use-postinstall-postinstall-with-yarn
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
chmod +x
vschmod 755
All In One
https://www.cnblogs.com/xgqfrms/p/14211682.html
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17246038.html
未经授权禁止转载,违者必究!