Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vilicvane/npm-fork
Publish forks of npm packages with ease.
https://github.com/vilicvane/npm-fork
npm npm-package npm-publish
Last synced: about 1 month ago
JSON representation
Publish forks of npm packages with ease.
- Host: GitHub
- URL: https://github.com/vilicvane/npm-fork
- Owner: vilicvane
- License: mit
- Created: 2023-10-05T14:59:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-22T18:02:22.000Z (about 1 year ago)
- Last Synced: 2024-11-30T15:41:59.161Z (about 1 month ago)
- Topics: npm, npm-package, npm-publish
- Language: TypeScript
- Homepage:
- Size: 96.7 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![NPM version](https://img.shields.io/npm/v/npm-fork?color=%23cb3837&style=flat-square)](https://www.npmjs.com/package/npm-fork)
[![Repository package.json version](https://img.shields.io/github/package-json/v/vilic/npm-fork?color=%230969da&label=repo&style=flat-square)](./package.json)
[![MIT License](https://img.shields.io/badge/license-MIT-999999?style=flat-square)](./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
```sh
npm install --global npm-fork
```## Usage
Commit or stage your changes and then use `npm-fork patch` to apply patches to the current project:
```sh
# 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`:
```sh
npm-fork publish --scope "@fork"
```## License
MIT License.