https://github.com/webdeveric/sync-package-version
Use your package.json version number in other files
https://github.com/webdeveric/sync-package-version
package sync version
Last synced: 5 months ago
JSON representation
Use your package.json version number in other files
- Host: GitHub
- URL: https://github.com/webdeveric/sync-package-version
- Owner: webdeveric
- License: mit
- Created: 2020-09-04T19:21:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-07T20:44:05.000Z (over 1 year ago)
- Last Synced: 2025-04-21T20:04:40.713Z (about 1 year ago)
- Topics: package, sync, version
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@webdeveric/sync-package-version
- Size: 405 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @webdeveric/sync-package-version
[](https://github.com/webdeveric/sync-package-version/actions/workflows/node.js.yml)
## Install
```shell
npm i @webdeveric/sync-package-version -D
```
## Usage
```json
{
"name": "YOUR-PACKAGE-NAME",
"version": "1.0.0",
"scripts": {
"version": "sync-package-version YOUR-JSON-FILE-HERE | xargs git add"
}
}
```
You can specify a custom version to use if you don't want the `version` from `package.json`.
```sh
sync-package-version --package-version "custom.version.here" [files...]
```
### Commands
#### `sync` (default)
##### Options
- `--package-version ` - Provide your own version number
- `--property-path ` - The path to the property in the destination file where you want to store the version number
- `--force` - Force a sync, ignoring destination data type
## Local development
```
npx corepack enable
pnpm install
pnpm build
```