tempack
v1.1.0
Published
Distribution builder
Downloads
4
Readme
Tempack
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