Skip to content

plus1tv/bibtex-bibjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BibTex-BibJson

Npm Package License

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.