Copy a package.json
copy-pkg package.json dist/package.json --only name,version
const copyPkg = require('copy-pkg');
copyPkg('package.json', 'dist/package.json', {
ignore: ['devDependencies'],
});
copyPkg.sync('package.json', 'dist/package.json', {
normalize: true,
});
yarn add copy-pkg
Options
opts.normalize
(--normalize
,-n
) - Normalize the package.json contents (boolean)opts.ignore
(--ignore
,-i
) - Select keys not to copy (array)opts.only
(--only
,-o
) - Select keys to copy (array)
Contributions to [Project name] are welcome! Please see CONTRIBUTING.md for details.
Copyright (c) 2017 - 2022 Atlassian and others. Apache 2.0 licensed, see LICENSE file.