New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

astrocite

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astrocite

Bibliography file format => AST => CSL JSON

  • 0.15.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
62
decreased by-16.22%
Maintainers
1
Weekly downloads
 
Created
Source

Join the chat at https://gitter.im/astrocite/Lobby Build Status codecov

astrocite

Bibliography Format => AST => CSL JSON

Mission: The goal of this project is to create a single location where high-quality, safe, and efficient X => CSL JSON parsers can be found.

What this project solves: Currently there exists a wide range of CSL JSON parsers for a variety of reference types. However, most of these parsers rely on unsafe or inefficent methods of parsing input files (generally using complex regular expressions with lookbehinds, or inefficiently looping over the same input text several times). This project abandons that strategy by first parsing input files into Abstract Syntax Trees and then parsing CSL JSON from the tree structure. The result of this is a safer, faster, and more predictable experience for developers.

NOTE: This project is currently a work in progress. The API is subject to change drastically and without warning. Any use of this library is at your own risk until either this message disappears or version ^1.x.x is released.

Table of Contents

Install

$ npm install astrocite

Usage

Modular (smaller bundles)

import { parse } from 'astrocite/bibtex';
// or
const parse = require('astrocite/bibtex').parse;

const cslJson = parse(`
@article{my_article,
    title = {Hello world},
    journal = "Some Journal"
}
`);

Classic

import * as astrocite from 'astrocite';
// or
const astrocite = require('astrocite');

const cslJson = astrocite.bibtex.parse(`
@article{my_article,
    title = {Hello world},
    journal = "Some Journal"
}
`);

ASTs are also available if needed.

import { AST } from 'astrocite/bibtex';
// or
// import { AST } from 'astrocite/ris';
// ....etc

const bibtexAST = AST.parse(`
@article{my_article,
    title = {Hello world},
    journal = "Some Journal"
}
`);

Note: Examples for each individual AST can be found in the README file of each subdirectory.

Contributing

PRs accepted. Please see our Roadmap and Contributing Guidelines for more details.

License

MIT © 2017 Derek P Sifford

Keywords

FAQs

Package last updated on 11 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc