bibtex-bibjson

📚 A tool to convert BibTeX documents to BibJSON.

Usage no npm install needed!

<script type="module">
  import bibtexBibjson from 'https://cdn.skypack.dev/bibtex-bibjson';
</script>

README

BibTex-BibJson

Npm Package License Travis Tests

Installation

npm i bibtex-bibjson -S

A tool to convert BibTeX citations to BibJSON.

Usage & Demo

Check out our Demo to try it out for yourself!

import {openFileSync} from 'fs';
import {parse} from 'bibtex-bibjson';

// Read file as string
let bibTexStr = openFileSync('./citations.bib');

// {} Convert to BibJson
// function parse(bibTexStr: string): object
let bibJson: Object = parse(bibTexStr);

Example

@article{hasselgren2020,
    author = {Hasselgren, Jon and Munkberg, J. and Salvi, Marco and Patney, A. and Lefohn, Aaron},
    year = {2020},
    title = {Neural Temporal Adaptive Sampling and Denoising},
    journal = {Computer Graphics Forum}
}

Becomes:

{
    "hasselgren2020": {
        "author": [
            { "name": "Jon Hasselgren" },
            { "name": "J. Munkberg" },
            { "name": "Marco Salvi" },
            { "name": "A. Patney" },
            { "name": "Aaron Lefohn" }
        ],
        "year": 2020,
        "title": "Neural Temporal Adaptive Sampling and Denoising",
        "journal": "Computer Graphics Forum",
    }
}

License

bibtex-bibjson is licensed as either MIT or Apache-2.0, whichever you would prefer.