tempack
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Tempack

NPM version

Small util which treats package.json as a distribution template.

Installation

$ npm i tempack -g

Usage

$ tempack [options] <dist>

<dist> - distribution directory path (default: ./dist)

Options:

  • -v, --version - output the version number
  • -c, --config-path [file] - config file path (default: tempack.json)
  • -p, --package-path [file] - package file path (default: package.json)
  • -s, --silent - turn on silent mode
  • --disable-colors - turn off colors
  • -h, --help - output usage information

Configuration

Field Default Value Description
mergePackageWith {} Additional destination package fields
omitPackageKeys [] Keys from source package that should be omitted
copyFiles [] List of files that should be copied
copyDirs [] List of directories that should be copied

via tempack.json:

{
  "mergePackageWith": {
    "version": "1.0.0",
    "main": "./index.js"
  },
  "omitPackageKeys": ["private", "devDependencies"],
  "copyFiles": ["README.md", "LICENSE.md"],
  "copyDirs": ["@types"]
}

via package.json:

{
  "name": "example",
  "version": "0.0.0",
  "private": true,
  "description": "Example Package",
  "devDependencies": {
    "lib": "0.0.0"
  },
  "tempack": {
    "mergePackageWith": {
       "version": "1.0.0",
       "main": "./index.js"
    },
    "omitPackageKeys": ["private", "devDependencies"],
    "copyFiles": ["README.md", "LICENSE.md"],
    "copyDirs": ["@types"]
  }
}

The above example will copy README.md, LICENSE.md files and @types directory into ./dist dir and build ./dist/package.json:

{
  "name": "example",
  "description": "Example Package",
  "version": "0.0.1",
  "main": "./index.js"
}

Testing

$ npm test

License

The MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i tempack

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

33.4 kB

Total Files

54

Last publish

Collaborators

  • staszek