
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
npm-prepare-dist
Advanced tools
Clean and prepare
distfolder and all files before publishing your NPM library
- Potentially smaller build and faster installation of your library
- TypeScript, JavaScript, CLI version
- Useful options
via yarn
yarn add npm-prepare-dist --dev
via npm
npm install npm-prepare-dist --save-dev
npm-prepare-dist
package.json file will be copied into your dist folderREADME.md (and other files) will be copied into dist folder as you wishimport { prepareDist } from 'npm-prepare-dist';
prepareDist('build', ['README.md', 'LICENSE', 'icon.svg'], './src/');
Highly recommended to use as postbuild hook in you package.json
{
"name": "my-project",
"scripts": {
"build": "tsc",
"postbuild": "npm-prepare-dist"
}
}
| Option | Description | default | example |
|---|---|---|---|
| -h, --help | Display this usage info | - | - |
| -v, --version | Show version | - | - |
| -d, --dist | Dist folder path | dist | -d build |
| -f, --files | Array of files to copy into dist folder as well | README.md | -f README.md -f LICENSE |
| -m, --main | Main folder where. Usually where is your index.js | ./ | -m ./src/ |
| -s, --remove-script | Remove script in package.json | - | -s postinstall -s test |
| --remove-deps | Remove all dependencies from package.json | - | --remove-deps |
I welcome you to customize this according to your needs ;)
Pull requests for any improvements would be great!
git clone git@github.com:bartholomej/npm-prepare-dist.git
cd npm-prepare-dist
yarn
yarn start
You can find and modify it in ./demo.ts file
yarn demo
If this project have helped you save time please consider making a donation for some 🍺 or 🍵 ;)
I DO NOT STORE ANY DATA. PERIOD.
I physically can't. I have nowhere to store it. I don't even have a server database to store it. So even if Justin Bieber asked nicely to see your data, I wouldn't have anything to show him.
That's why, with this library, what happens on your device stays on your device till disappear.
Copyright © 2021 Lukas Bartak
Proudly powered by nature 🗻, wind 💨, tea 🍵 and beer 🍺 ;)
All contents are licensed under the MIT license.
FAQs
Prepare library for NPM distribution
The npm package npm-prepare-dist receives a total of 157 weekly downloads. As such, npm-prepare-dist popularity was classified as not popular.
We found that npm-prepare-dist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.