6

I am looking for Javascript library for parsing BibTeX files. Ideally, I would like to be able to cite papers and generate publication lists from BibTeX database (files with .bib extension). Any tips regarding what I should go with?

I am aware of bibtex-js. Is there anything else available?

blazs
  • 4,705
  • 24
  • 38

2 Answers2

4

I made a project, incidentally also called bibtex-js. Also available on npm.

I made it because most BibTeX parsers out there take considerable shortcuts in parsing. This one aligns closely with the authoritative document on BibTeX, Tame the BeaST and parses bibfiles into well defined objects.

Typescript types are included.

npm install bibtex

And then:

import {parseBibFile} from "bibtex";
const bibFile = parseBibFile(bibtexString);
Maarten
  • 6,894
  • 7
  • 55
  • 90
3

It depends on what you want the output to be. If you want to spit out JSON, then the definite go to choice is bibtex-parser-js. If you want to generate HTML rendered from the bib input, then there's a few options: bibtex2html (OCaml) bibhtml (XSLT) bib2xhtml (Perl) bibtex2web (Perl)

...but they're not JavaScript. However, this might be useful for you: bib-publication-list

mernst
  • 7,437
  • 30
  • 45
Yehia
  • 518
  • 2
  • 17