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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@altmetric/identifiers

v1.0.0

Published

Extract scholarly identifiers (DOI, arXiv, ORCID, PubMed, Bibcode, Handle, NCT, RePEc, URN)

Readme

@altmetric/identifiers

CI npm

Extract scholarly identifiers from text strings. Supports Node.js 18, 20, and 22.

Supported Identifiers

  • DOI - Digital Object Identifiers (including ISBN-As)
  • arXiv - arXiv preprint identifiers (pre-2007 and post-2007 formats)
  • ORCID - Open Researcher and Contributor IDs (with checksum validation)
  • PubMed - PubMed identifiers
  • Bibcode - ADS Bibliographic Codes
  • Handle - Handle System identifiers
  • NCT - National Clinical Trial identifiers
  • RePEc - Research Papers in Economics identifiers
  • URN - Uniform Resource Names

Installation

npm install @altmetric/identifiers

Usage

Import individual identifiers (recommended for tree-shaking)

import { extract } from "@altmetric/identifiers/doi";

extract("This is a DOI: 10.1234/foo.bar");
//=> ["10.1234/foo.bar"]

Import multiple identifiers

import { extract as extractDoi } from "@altmetric/identifiers/doi";
import { extract as extractArxiv } from "@altmetric/identifiers/arxiv";

extractDoi("10.1234/foo.bar");
//=> ["10.1234/foo.bar"]

extractArxiv("arXiv:1501.00001v2");
//=> ["1501.00001v2"]

Import all identifiers

import * as identifiers from "@altmetric/identifiers";

identifiers.doi.extract("10.1234/foo.bar");
//=> ["10.1234/foo.bar"]

identifiers.arxiv.extract("math.GT/0309136");
//=> ["math.GT/0309136"]

identifiers.orcid.extract("0000-0002-0488-8591");
//=> ["0000-0002-0488-8591"]

URN special case

The URN module exports both extract() (normalized) and scan() (raw):

import { extract, scan } from "@altmetric/identifiers/urn";

scan("URN:FOO:BAR");
//=> ["URN:FOO:BAR"]

extract("URN:FOO:BAR");
//=> ["urn:foo:BAR"]

TypeScript

Type definitions are included for all modules.

import { extract } from "@altmetric/identifiers/doi";

const dois: string[] = extract("10.1234/foo");

Migration from individual packages

This package replaces the following individual packages:

| Old package | New import | |---|---| | identifiers-arxiv | @altmetric/identifiers/arxiv | | identifiers-bibcode | @altmetric/identifiers/bibcode | | identifiers-doi | @altmetric/identifiers/doi | | identifiers-handle | @altmetric/identifiers/handle | | identifiers-nct | @altmetric/identifiers/nct | | identifiers-orcid | @altmetric/identifiers/orcid | | identifiers-pubmed | @altmetric/identifiers/pubmed | | identifiers-repec | @altmetric/identifiers/repec | | identifiers-urn | @altmetric/identifiers/urn |

The API is the same — every module exports an extract() function (URN also exports scan()). The only change is the import path and switching from CommonJS require() to ES module import:

// Before (CommonJS)
const doi = require("identifiers-doi");
doi.extract("10.1234/foo");

// After (ES modules)
import { extract } from "@altmetric/identifiers/doi";
extract("10.1234/foo");

Other versions

We also maintain versions of these libraries for Ruby and PHP.

License

Copyright © 2017-2026 Altmetric LLP

Distributed under the MIT License.