{"id":27275166,"url":"https://github.com/continuous-foundation/doi-utils","last_synced_at":"2025-04-11T15:32:37.055Z","repository":{"id":37255497,"uuid":"494180953","full_name":"continuous-foundation/doi-utils","owner":"continuous-foundation","description":"A toolkit to for handling DOI(Digital Object Identifier)","archived":false,"fork":false,"pushed_at":"2025-04-04T14:28:04.000Z","size":225,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T19:40:34.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/continuous-foundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-19T18:08:48.000Z","updated_at":"2025-03-04T17:45:35.000Z","dependencies_parsed_at":"2024-05-09T05:32:01.775Z","dependency_job_id":"24c6cca2-31c1-4072-8a4b-b6f40703681e","html_url":"https://github.com/continuous-foundation/doi-utils","commit_stats":{"total_commits":44,"total_committers":3,"mean_commits":"14.666666666666666","dds":0.4545454545454546,"last_synced_commit":"1956402faf4708736d74abd076e7cc7607b1b6ff"},"previous_names":["continuous-foundation/doi-utils"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fdoi-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fdoi-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fdoi-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continuous-foundation%2Fdoi-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/continuous-foundation","download_url":"https://codeload.github.com/continuous-foundation/doi-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248431332,"owners_count":21102184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-11T15:30:59.381Z","updated_at":"2025-04-11T15:32:37.041Z","avatar_url":"https://github.com/continuous-foundation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `doi-utils`\n\n[![doi-utils on npm](https://img.shields.io/npm/v/doi-utils.svg)](https://www.npmjs.com/package/doi-utils)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/continuous-foundation/doi-utils/blob/master/LICENSE)\n![CI](https://github.com/continuous-foundation/doi-utils/actions/workflows/ci.yml/badge.svg)\n\nA small utility for validating, normalizing, and extracting DOIs from text strings.\nThis repository follows the advice of [CrossRef](https://www.crossref.org/blog/dois-and-matching-regular-expressions/) for regular expression patterns.\n\n\u003e For the 74.9M DOIs we have seen this matches 74.4M of them. If you need to use only one pattern then use this one.\n\nThe utility also recognizes URLs that are likely DOIs, and has specific handling for some repositories (e.g. eLife, Zenodo).\n\n## Install\n\n```bash\nnpm install doi-utils\n```\n\n## Overview \u0026 Usage\n\n```ts\nimport { doi } from 'doi-utils';\n\nconst isValid = doi.validate('http://doi.org/10.1016/j.cageo.2015.09.015');\n\ndoi.buildUrl('http://dx.doi.org/10.1016/j.cageo.2015.09.015');\ndoi.buildUrl('http://www.doi.org/10.1016/j.cageo.2015.09.015');\ndoi.buildUrl('http://doi.org/10.1016/j.cageo.2015.09.015');\ndoi.buildUrl('doi:10.1016/j.cageo.2015.09.015');\n// All of these produce a normalized, secure DOI url:\n// https://doi.org/10.1016/j.cageo.2015.09.015\n```\n\n## Included Utilities\n\n- `validate` - Validates if a single DOI string is valid, is tolerant of leading link or `doi:` strings.\n- `validatePart` - Validate the \"10.1016/j.cageo.2015.09.015\" part of a DOI.\n- `normalize` - Normalizes a DOI url or string into a DOI of the form `10.1000/xyz000`\n- `buildUrl` - Builds a URL to https://doi.org, includes normalization\n- `isOpenFunderRegistry` - Returns true if the DOI is in the [Open Funder Registry](https://www.crossref.org/documentation/funder-registry/)\n\n## Options\n\n- `strict`: only accept doi.org URLs and `doi:` prefixes\n\n---\n\nAs of v2.0.0 this package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\n\n---\n\n\u003cp style=\"text-align: center; color: #aaa; padding-top: 50px\"\u003e\n  Made with love by\n  \u003ca href=\"https://continuous.foundation\" target=\"_blank\" style=\"color: #aaa\"\u003e\n    Continuous Science Foundation \u003cimg src=\"https://continuous.foundation/images/logo-small.svg\" style=\"height: 1em\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontinuous-foundation%2Fdoi-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontinuous-foundation%2Fdoi-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontinuous-foundation%2Fdoi-utils/lists"}