Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-dois

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-dois

Detect Digital Object Identifiers listed in the metadata of a DOM tree

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

get-dois

A small module that takes a DOM tree and returns all Digital Object Identifiers (DOIs) located in that tree's metadata.

Unfortunately, academic publishers use a wide variety of metadata "standards". This package normalises between Dublin Core, Highwire Press tags, etc., and the different formatting rules used for DOIs.

To use this library outside of a browser context, you can use a library like jsdom.

This project also includes TypeScript type definitions.

Installation

npm install get-dois --save

Usage

import { getDois } from 'get-dois';

const head = document.getElementsByTagName('head').item(0);
const dois = getDois(head);
//=> [ '10.31222/osf.io/796tu' ]

API

getDois(domTree: Document | Element): string[]

Parameter: domTree

Either window.document or an HTML element whose children might include meta tags containing a DOI.

Returns

An array of DOIs. If no DOIs are found, this will return an empty array. Duplicate DOIs will only be listed once. Note that a page might list multiple DOIs.

Supported meta tags

At the time of writing, get-dois supports detecting DOIs embedded in a webpage as:

  • Highwire Press tags (citation_doi)
  • Eprints tags (eprints.id_number and/or eprints.official_url)
  • bepress tags (bepress_citation_doi)
  • PRISM tags (prism.doi)
  • Dublin Core Schema markup (dc.identifier and/or dc.relation)

If you encounter a different format that is not yet supported, please file an issue.

Changelog

See CHANGELOG.md.

License

MIT © Vincent Tunru

Keywords

FAQs

Package last updated on 19 Jul 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