Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oscard0m/npm-snapshot
A little script to help with prerelease npm modules.
https://github.com/oscard0m/npm-snapshot
npm npm-publish
Last synced: 11 days ago
JSON representation
A little script to help with prerelease npm modules.
- Host: GitHub
- URL: https://github.com/oscard0m/npm-snapshot
- Owner: oscard0m
- License: mit
- Created: 2021-02-09T21:35:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-16T20:49:24.000Z (5 months ago)
- Last Synced: 2024-10-11T10:15:42.182Z (27 days ago)
- Topics: npm, npm-publish
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npm-snapshot
A little script to help with prerelease `npm` modules.
## Usage
You must use `npm-snapshot` in a folder with a `package.json`.
`npm-snapshot 245`
The argument to this utility is a unique, monotonically increasing number (say, a build number from Travis or Shippable)
that will be appended to the prerelease portion of the existing version. If there is no current prerelease portion of the
version, the string 'SNAPSHOT' will be used. Any existing prerelease portion will be preserved, up to the first '.'.For example, given the version "1.2.4", calling
`npm-snapshot 245`
will change the package.json to be "1.2.4-SNAPSHOT.245".
Additionally, the prerelease prefix is emitted on standard out. This is useful as a tag when publishing. For example:
```bash
BUILD_TAG = $(npm-snapshot $BUILD_NUMBER)
npm publish --tag BUILD_TAG
```## Install
`npm install -g npm-snapshot`
## License
MIT