https://github.com/hustcc/inject-version
Inject version into your source code when prepublishOnly.
https://github.com/hustcc/inject-version
Last synced: 15 days ago
JSON representation
Inject version into your source code when prepublishOnly.
- Host: GitHub
- URL: https://github.com/hustcc/inject-version
- Owner: hustcc
- License: mit
- Created: 2020-09-21T05:16:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-21T05:53:17.000Z (over 4 years ago)
- Last Synced: 2025-02-14T04:27:47.416Z (2 months ago)
- Language: TypeScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inject-version
> CLI tool to inject `version` into your source code when `prepublishOnly`.
[](https://www.npmjs.com/package/inject-version)
[](https://github.com/hustcc/inject-version/actions)
[](https://www.npmjs.com/package/inject-version)
[](https://www.npmjs.com/package/inject-version)## Install
```bash
$ npm i --save-dev inject-version
```## Usage
- Add the `prepublishOnly` script to your `package.json` with `inject-version`:
```diff
"scripts": {
+ "prepublishOnly": "inject-version ./src/index.ts",
"test": "jest"
},
```## License
MIT@[hustcc](https://github.com/hustcc).