Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chrvadala/const-version

:sparkles: A tiny command line tool that extract `package.json` version and generate `export const VERSION='...'` file. Useful when you want to package your software version.
https://github.com/chrvadala/const-version

bundle cli es6 javascript tool versioning

Last synced: about 1 month ago
JSON representation

:sparkles: A tiny command line tool that extract `package.json` version and generate `export const VERSION='...'` file. Useful when you want to package your software version.

Awesome Lists containing this project

README

        

# const-version
A tiny command line tool that extract `package.json` version and generate `export const VERSION=x.y.z` file. Useful when you want to package your software version.

[![chrvadala](https://img.shields.io/badge/website-chrvadala-orange.svg)](https://chrvadala.github.io)
[![Test](https://github.com/chrvadala/const-version/workflows/Test/badge.svg)](https://github.com/chrvadala/const-version/actions)
[![Coverage Status](https://coveralls.io/repos/github/chrvadala/const-version/badge.svg?branch=main)](https://coveralls.io/github/chrvadala/const-version?branch=main)
[![npm](https://img.shields.io/npm/v/const-version.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/const-version)
[![Downloads](https://img.shields.io/npm/dm/const-version.svg)](https://www.npmjs.com/package/const-version)
[![Donate](https://img.shields.io/badge/donate-GithubSponsor-green.svg)](https://github.com/sponsors/chrvadala)

# Install
```sh
npm install const-version
```

# Usage

```
{
"name": "yourproject",
"version": "x.y.z",
"scripts": {
"generate-version": "const-version ./package.json ./src/version.js"
}
}
```
Example of a generated file
```js
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
export const VERSION = 'x.y.z';
```

# Changelog
- **v1.0** - First release
- **v2.0** - Changes some dependencies
- **v2.1** - Shrinks and upgrades deps; Implements gh-actions; Improves docs; Implements standard.js; Increases code coverage

# Contributors
- [chrvadala](https://github.com/chrvadala) (author)