biblib-ts

A powerful library for parsing various academic reference file formats in Node.js.

https://github.com/aliazlandev/biblib-ts

Science Score: 31.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

A powerful library for parsing various academic reference file formats in Node.js.

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed 12 months ago
Metadata Files
Readme License Citation

README.md

BibLib

A TypeScript library for parsing various academic reference file formats in browser.

This library is inspired by the @iebh/reflib, but is designed to be lightweight and efficient for use in web applications.

Features

  • Parse multiple reference file formats:
    • RIS (Research Information Systems)
    • Medline
    • EndNote XML
    • BibTeX
    • CSV
  • Standardized output format for all parsers
  • TypeScript support with full type definitions
  • Configurable parsing options
  • Author name normalization
  • DOI handling and validation
  • Page number formatting

Installation

bash npm install biblib

Usage

```typescript import { parseRIS, parseMedline, parseEndnoteXML, parseBibTeX, parseCSV, } from 'biblib';

// Parse RIS file const risRefs = await parseRIS(risContent, { defaultType: 'journalArticle', delimeter: '\r', });

// Parse Medline file const medlineRefs = await parseMedline(medlineContent, { reformatAuthors: true, journal: 'long', parseAddress: true, });

// Parse EndNote XML file const endnoteRefs = await parseEndnoteXML(xmlContent, { defaultType: 'journalArticle', });

// Parse BibTeX file const bibtexRefs = await parseBibTeX(bibtexContent, { removeComments: true, defaultType: 'journalArticle', });

// Parse CSV file const csvRefs = await parseCSV(csvContent, { defaultType: 'journalArticle', }); ```

API Reference

Common Output Format

All parsers return references in a standardized format:

```typescript interface BibLibRef { type?: string; title?: string; authors?: string[]; journal?: string; year?: string; volume?: string; number?: string; pages?: string; doi?: string; urls?: string[]; abstract?: string; keywords?: string[]; date?: string; isbn?: string; language?: string; notes?: string; label?: string;

} ```

RIS Parser

typescript parseRIS(content: string, options?: { defaultType?: string; // Default: 'journalArticle' delimeter?: string; // Default: '\r' }): Promise<BiblibRef[]>

Medline Parser

typescript parseMedline(content: string, options?: { defaultType?: string; // Default: 'journalArticle' delimeter?: string; // Default: '\r' reformatAuthors?: boolean; // Default: true journal?: 'long' | 'short'; // Default: 'long' parseAddress?: boolean; // Default: true parseDoi?: boolean; // Default: true parseYear?: boolean; // Default: true }): Promise<BiblibRef[]>

EndNote XML Parser

typescript parseEndnoteXML(content: string, options?: { defaultType?: string; // Default: 'journalArticle' }): Promise<BiblibRef[]>

BibTeX Parser

typescript parseBibTeX(content: string, options?: { removeComments?: boolean; // Default: true defaultType?: string; // Default: 'journalArticle' delimeter?: string; // Default: '\n' }): Promise<BiblibRef[]>

CSV Parser

typescript parseCSV(content: string, options?: { defaultType?: string; // Default: 'journalArticle' }): Promise<BiblibRef[]>

Features in Detail

Author Name Handling

The library automatically normalizes author names into a consistent format (A. Azlan):

  • Handles various input formats (Firstname Lastname, Lastname, Firstname, etc.)
  • Properly handles middle names and initials
  • Preserves suffixes (Jr., Sr., III, etc.)

DOI Handling

  • Automatically adds 'doi.org' prefix when missing
  • Validates DOI format
  • Removes common prefixes (doi:, http://dx.doi.org/, etc.)

Page Number Formatting

  • Standardizes page number formats (e.g., "123-129", "123--129", "123 to 129")
  • Handles single page numbers
  • Preserves complex page numbers when needed

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Owner

  • Name: Ali Azlan
  • Login: AliAzlanDev
  • Kind: user
  • Location: Lahore, Pakistan

Medical student and Web developer

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Azlan"
  given-names: "Ali"
  orcid: "https://orcid.org/0009-0006-6887-2026"
title: "AliAzlanDev/biblib-ts: v0.1.4"
version: v0.1.4
doi: 10.5281/zenodo.15171973
date-released: 2025-04-08
url: "https://github.com/AliAzlanDev/biblib-ts"

GitHub Events

Total
  • Push event: 4
  • Public event: 1
Last Year
  • Push event: 4
  • Public event: 1

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 12
  • Total Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.167
Past Year
  • Commits: 12
  • Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.167
Top Committers
Name Email Commits
Ali Azlan 1****o 10
Ali Azlan 1****v 2

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

package-lock.json npm
  • 271 dependencies
package.json npm
  • @arethetypeswrong/cli ^0.17.2 development
  • @changesets/cli ^2.27.7 development
  • @types/lodash ^4.17.13 development
  • @types/node ^22.10.2 development
  • prettier ^3.4.2 development
  • rimraf ^5.0.5 development
  • typescript ^5.7.2 development
  • vitest ^2.1.8 development
  • bibtex-parse ^2.1.0
  • csv-parse ^5.6.0
  • htmlparser2 ^10.0.0
  • lodash ^4.17.21