npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

transtex

v1.0.1

Published

This library supports bidirectional conversion between APA 6th, IEEE, and other paper reference formats and BibTeX.

Readme

TransTex (TypeScript)

TypeScript/Node bindings for TransTex: BibTeX parsing/serialization and citation formatting for APA 6th/7th, IEEE, MLA 9th, Chicago (author-date), and Vancouver. Includes reverse parsing from citations back to BibTeX.

Install

yarn add transtex

Usage

Format a reference in multiple styles:

import {
    Reference,
    formatApa,
    formatApa7,
    formatIeee,
    formatMla,
    formatChicago,
    formatVancouver,
    referenceToBibtex,
} from "transtex";

const ref = new Reference({
    entryType: "article",
    citeKey: "doe2020deep",
    title: "Deep Learning for Everything",
    authors: ["John Doe", "Jane Smith"],
    journal: "Journal of Omniscience",
    year: "2020",
    volume: "42",
    issue: "7",
    pages: "1-10",
    doi: "10.1000/j.jo.2020.01.001",
});

console.log(formatApa(ref));
console.log(formatApa7(ref));
console.log(formatIeee(ref));
console.log(formatMla(ref));
console.log(formatChicago(ref));
console.log(formatVancouver(ref));

console.log(referenceToBibtex(ref));

Parse a citation back to BibTeX:

import { citationToBibtex, convertCitation } from "transtex";

const ieeeCitation =
    'J. Doe and J. Smith, "Deep Learning for Everything," Journal of Omniscience, vol. 42, no. 7, pp. 1–10, 2020, doi: 10.1000/j.jo.2020.01.001.';
const bibtex = citationToBibtex("ieee", ieeeCitation);
console.log(bibtex);

const apaCitation = convertCitation("ieee", "apa7", ieeeCitation);
console.log(apaCitation);

Book / conference / web examples (see examples/bookAndWebExamples.ts):

const bookRef = new Reference({
    entryType: "book",
    citeKey: "turing1950",
    title: "Computing Machinery and Intelligence",
    authors: ["Alan M. Turing"],
    publisher: "Oxford University Press",
    place: "Oxford, UK",
    year: "1950",
    edition: "2nd ed.",
    pages: "1-120",
    doi: "10.1000/book.1950.01",
});

const confRef = new Reference({
    entryType: "inproceedings",
    citeKey: "doe2023conf",
    title: "Neural Widgets for Everything",
    authors: ["John Doe", "Jane Smith"],
    eventTitle: "Proceedings of the 40th International Neural Conference",
    eventLocation: "Berlin, Germany",
    publisher: "Neural Press",
    year: "2023",
    pages: "101-110",
    doi: "10.1000/conf.2023.101",
});

console.log(formatApa(bookRef));
console.log(formatIeee(confRef));

Scripts

  • yarn build — compile to dist/
  • yarn test — run vitest unit tests
  • yarn example:format — format a sample BibTeX entry into all styles
  • yarn example:citations — parse APA/IEEE citations back to BibTeX
  • run other examples via yarn ts-node examples/bookAndWebExamples.ts
  • convert between styles via yarn ts-node examples/convertCitationStyles.ts

Files published

Only dist/, README.md, and LICENSE are shipped in the npm package.