Skip to content

Instantly share code, notes, and snippets.

@dannycroft
Created May 18, 2015 08:23
Show Gist options
  • Select an option

  • Save dannycroft/f0e3b766d8a7fd273766 to your computer and use it in GitHub Desktop.

Select an option

Save dannycroft/f0e3b766d8a7fd273766 to your computer and use it in GitHub Desktop.
clean-shrinkwrap-task
node -e '
function clean(j) {
if (!j) return
for (var k in j) {
delete j[k].from
delete j[k].resolved
if (j[k].dependencies) clean(j[k].dependencies)
}
}
x = JSON.parse(require("fs").readFileSync("./npm-shrinkwrap.json"))
clean(x.dependencies)
x = JSON.stringify(x, null, " ")
require("fs").writeFileSync("./npm-shrinkwrap.json", x + "\n")
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment