Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const writeVersion = () => new Promise((resolve, reject) => {
const { version } = config
const numbers = version.split('.')
numbers[2] = Number(numbers[2]) + 1
config.version = numbers.join('.')
fs.writeFile(path.join(__dirname, 'package.json'), beautify(JSON.stringify(config), { indent_size: 2 }), (err) => {
if (err) {
reject()
}
resolve()
console.log(`version: ${config.version}`)
})
})