Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
amend-package
Advanced tools
Modify npm installed packages.
npm install -D amend-package
amend-package.config.js
(or name it yourself)xxx.config.js
, list it using --list-builtin-config
and use it directly using --builtin-config xxx.config.js
.postinstall
of the package.json
of you project, then it can be called automatically after npm install. e.g.:{
"scripts": {
"postinstall": "npx amend-package --config amend-package.config.cjs"
}
}
# Print help
npx amend-package --help
# Modify all packages.
npx amend-package --config amend-package.config.cjs
# Modify all packages, but try run without real modification.
npx amend-package --config amend-package.config.cjs --dry-run
# Modify the specified package.
npx amend-package --config amend-package.config.cjs --package some_pkg_name
# Revert the modifications to all packages.
npx amend-package --config amend-package.config.cjs --revert
# Revert the modifications to the specified package.
npx amend-package --config amend-package.config.cjs --revert --package some_pkg_name
--help Print help.
--config Specify the config file path. At present only CommonJS is supported in the config file. The config file is loaded via const config = require(require('node:path').resolve(cmdInputConfigPath)). See the example config files in "amend-package/builtin-config/*.config.cjs". Either --builtin-config or --config must be specified.
--builtin-config Specify the config file name. e.g. --builtin-config fix-vue-echarts-esm.config.cjs Either --builtin-config or --config must be specified.
--list-builtin-config List built-in config files.
--dry-run Just log what will be changed but do not change anything.
--package <package_name> Specify the package (npm package name) to modify. If not specified, modify all packages. e.g. --package some_pkg_name
--revert Revert the modifications.
--builtin-case List built-in cases.
--case <case_name> Specify a case to run. If not specified, run all cases.
module.exports = {
amenderMap: {
'some_package_1': ({setPkgJSONAttr, ensureSubPkgJSON}) => {
setPkgJSONAttr('type', 'module');
setPkgJSONAttr('exports', {
".": {
"types": "./index.d.ts",
"require": "./dist/zrender.js",
"import": "./index.js"
},
"./*": "./*",
});
ensureSubPkgJSON(['dist'], ({setPkgJSONAttr}) => setPkgJSONAttr('type', 'commonjs'));
ensureSubPkgJSON(['build'], ({setPkgJSONAttr}) => setPkgJSONAttr('type', 'commonjs'));
},
'some_package_2': ({setPkgJSONAttr, ensureSubPkgJSON}) => {
// ...
},
// ...
},
};
FAQs
Modify npm installed packages.
The npm package amend-package receives a total of 2 weekly downloads. As such, amend-package popularity was classified as not popular.
We found that amend-package 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.