Home Reference Source Repository


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


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

From scripts section of your package.json:

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


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))