Skip to content

Builds your package.json file from component parts. Fixes environment variable usage to make scripts Windows and OSX compatible.

License

Notifications You must be signed in to change notification settings

noderaider/repackage

Repository files navigation

Transforms a set of package.json transforms to create a new package.json. Targets a specific platform for output so scripts are cross compatible with Windows and OSX.

Save as a dev dependency.

npm i -D repackage

CLI

repackage /path/to/package.scripts.json [path/to/package.json]

  • If package.json path left blank, current working directory is assumed.
  • Can be installed globally but it is recommended to save as a dev dependency and run from a package.json script.
  • Only creates new or overwrites nodes, never deletes nodes.

From scripts section of your package.json:

{
  "scripts": {
    "build-package": "repackage src/package/package.scripts.json",
    "prebuild": "npm run build-package",
    "build": "..."
  }
}

API

import createRepackage from 'repackage'
const repackage = createRepackage({ log: console })
repackage('path/to/transform/dir', 'path/to/package.json')
  .then(message => console.info(message))
  .catch(err => console.error(err))

About

Builds your package.json file from component parts. Fixes environment variable usage to make scripts Windows and OSX compatible.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages