0.0.5 • Published 5 months ago

npm-fork v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

NPM version Repository package.json version MIT License

npm-fork

Publish forks of npm packages with ease.

Occasionally, we fork an npm project to fix some bugs or add some features. But to publish the forked package, we have to manually change the package name and version in package.json and JavaScript files. This tool automates the process and leave the source code untouched.

What it does?

  1. It patches package.json and JavaScript files (using npm-packlist) with different/additional scope and prerelease versions.
  2. It runs npm publish to publish the forked packages.
  3. It runs git restore . to reset the patches after publishing.

Installation

npm install --global npm-fork

Usage

Commit or stage your changes and then use npm-fork patch to apply patches to the current project:

# single package
npm-fork patch --scope "@fork"

# multiple packages
npm-fork patch --scope "@fork" --package "name" --package "@origin/*"

# use package paths instead of names if workspace is not configured or recognized (e.g., pnpm).
npm-fork patch --scope "@fork" --package "packages/*"

Or directly npm-fork publish:

npm-fork publish --scope "@fork"

License

MIT License.