Skip to content

Copy a package.json with filters and normalization

License

Notifications You must be signed in to change notification settings

atlassian/copy-pkg

Repository files navigation

copy-pkg

Atlassian license PRs Welcome

Copy a package.json

Usage

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,
});

Installation

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

Contributions to [Project name] are welcome! Please see CONTRIBUTING.md for details.

License

Copyright (c) 2017 - 2022 Atlassian and others. Apache 2.0 licensed, see LICENSE file.

Related

With Thanks! from Atlassian