Skip to content

Instantly share code, notes, and snippets.

@henryoswald
Created December 14, 2015 15:34
Show Gist options
  • Save henryoswald/145b7399dc1ef35a6c7b to your computer and use it in GitHub Desktop.
Save henryoswald/145b7399dc1ef35a6c7b to your computer and use it in GitHub Desktop.
fs = require("fs")
bib2json = require("./bib2json.js")
f = fs.readFileSync("../listb.bib", "utf-8")
_ = require("lodash")
json = bib2json(f)
j = _.map json.entries, (ent)->
return {key:ent.EntryKey, author:ent.Fields.author, journal: ent.Fields.journal, title:ent.Fields.title, year: ent.Fields.year}
fs.writeFileSync("./bib.smaller.json", JSON.stringify(j))
fs.writeFileSync("./bib.json", JSON.stringify(json))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment