Skip to content

Instantly share code, notes, and snippets.

@timothycarambat
Created March 31, 2020 00:37
Show Gist options
  • Save timothycarambat/9cd9fc054df6ac0bd312cda3e2390c63 to your computer and use it in GitHub Desktop.
Save timothycarambat/9cd9fc054df6ac0bd312cda3e2390c63 to your computer and use it in GitHub Desktop.
Package.json - update version number - no SVN. Made for discord user.
const fs = require('fs');
const fileName = './package.json';
const file = require(fileName);
const currentVersion = file.version ? +file.version : 0
file.version = String(currentVersion + 1)
fs.writeFile(fileName, JSON.stringify(file,null,2), function writeJSON(err) {
if (err) return console.log(err);
console.log(JSON.stringify(file ,null,2));
console.log('writing to package.json');
});
{
"name": "",
"version": "3",
"dependencies": {
"fs": "0.0.1-security"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment