const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); pkg.version = process.argv[2]; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));