Skip to content

Instantly share code, notes, and snippets.

@kawanet
Created May 6, 2015 07:30
Show Gist options
  • Select an option

  • Save kawanet/2937c7dff95404c96c43 to your computer and use it in GitHub Desktop.

Select an option

Save kawanet/2937c7dff95404c96c43 to your computer and use it in GitHub Desktop.
Increment a property value in a JSON file
require("fs").writeFileSync("build.json",JSON.stringify(require("obop").update({$inc:{build:1}})(JSON.parse(require("fs").readFileSync("build.json")))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment