Pobierz wersję z pakietu.json
import {version} from './package.json';
Tired Tapir
import {version} from './package.json';
process.env.npm_package_version
node -pe "require('./package.json')['version']"
# From 1.0.0 -> 1.0.1
npm version patch
# From 1.0.1 -> 1.1.0
npm version minor
# From 1.1.0 -> 2.0.0
npm version major
$(node -pe 'require(\"./package.json\")[\"version\"]')