1.0.8 • Published 5 years ago
npm-dist v1.0.8
npm-dist
Trim node_modules, copy to dist/node_modules, smaller and faster than before, for server side
Installation
Install via npm
:
$ npm i npm-dist
Usage
const Trim = require('npm-dist')
// Installed joi@17.3.0
// total 109 files, 905kb
Trim('joi') // 64 file 504kb
Trim(pkgName, distPath)
field | required | desc |
---|---|---|
pkgName | true | String, 'joi' |
distPath | false | String, default is 'dist' |
returns | - | |
throws | Error |
Rules
- Delete package.json, pkg.main is no longer needed
- Save only reference files
- When there is only one file, move the package to the root directory
Authors
Yanglin (i@yangl.in)
License
Copyright (c) 2020 Yanglin
Released under the MIT license