{"id":25253247,"url":"https://github.com/nothingrandom/publication-ids","last_synced_at":"2026-03-18T02:32:18.962Z","repository":{"id":276835282,"uuid":"926800730","full_name":"nothingrandom/publication-ids","owner":"nothingrandom","description":"Javascript / Typescript validator and parser for publication ids; DOI, PMID, PMCID, ISBN, and ISSN","archived":false,"fork":false,"pushed_at":"2025-10-02T12:29:38.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-19T13:48:35.761Z","etag":null,"topics":["bun","doi","isbn","isbn-13","node-module","nodejs","npm-package","publishing","typescript"],"latest_commit_sha":null,"homepage":"","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/nothingrandom.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-03T21:58:45.000Z","updated_at":"2025-10-02T12:27:47.000Z","dependencies_parsed_at":"2025-10-27T00:31:40.132Z","dependency_job_id":"c06ffa1e-e80b-41f0-b443-098cfa92e4c7","html_url":"https://github.com/nothingrandom/publication-ids","commit_stats":null,"previous_names":["nothingrandom/publication-ids"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/nothingrandom/publication-ids","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothingrandom%2Fpublication-ids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothingrandom%2Fpublication-ids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothingrandom%2Fpublication-ids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothingrandom%2Fpublication-ids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nothingrandom","download_url":"https://codeload.github.com/nothingrandom/publication-ids/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothingrandom%2Fpublication-ids/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30642995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-18T01:41:58.583Z","status":"online","status_checked_at":"2026-03-18T02:00:07.824Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bun","doi","isbn","isbn-13","node-module","nodejs","npm-package","publishing","typescript"],"created_at":"2025-02-12T04:58:47.950Z","updated_at":"2026-03-18T02:32:18.916Z","avatar_url":"https://github.com/nothingrandom.png","language":"TypeScript","readme":"# publication-ids\nJavascript / Typescript validator and parse for publication ids; DOI, PMID, PMCID, ISBN, and ISSN.\nAllows for validation of publication ids and parsing of publication ids from text.\n\n## Installation\n```bash\nnpm install publication-ids\n```\n\n## Usage\n#### CLI\n\nYou can use the CLI to parse publication ids from the command line, this supports DOI, ISBN, ISSN, PubMed ID (PMID) and PubMed Central ID (PMCID).\n\n```bash\n# DOI\nnpx publication-ids \"10.1234/5678\"\n\n# Output:\n# [\n#   {\n#     source: '10.1234/5678',\n#     doi: '10.1234/5678',\n#     isValid: true,\n#     resolve: 'https://doi.org/10.1234/5678',\n#     isbn: { isValid: false }\n#   }\n# ]\n\n# ISBN\nnpx publication-ids \"978-3-16-148410-0\"\n# Output:\n# [\n#   {\n#     source: '978-3-16-148410-0',\n#     isValid: true,\n#     isbn10: '316148410X',\n#     isbn13: '9783161484100'\n#   }\n# ]\n\n# DOI, which is an ISBN chapter\nnpx publication-ids \"10.4324/9780203765449-11\"\n# Output:\n# [\n#   {\n#     source: '10.4324/9780203765449-11',\n#     doi: '10.4324/9780203765449',\n#     isValid: true,\n#     resolve: 'https://doi.org/10.4324/9780203765449',\n#     isbn: {\n#       source: '9780203765449',\n#       isValid: true,\n#       isbn10: '0203765443',\n#       isbn13: '9780203765449',\n#       chapter: '11'\n#     }\n#   }\n# ]\n```\n\n#### Codebase\n\n```ts\nimport PublicationIds from 'publication-ids';\n\n// To guess the type of publication id, use the parse function.\n// Parse will return an **array** of all possible publication ids that can be parsed from the input.\n// The input can be a string or an array of strings.\nconst ids = PublicationIds.parse('10.1234/5678');\nids.map(id =\u003e {\n  console.log(id);\n  /*\n    {\n      source: '10.1234/5678';\n      isValid: true;\n      doi: '10.1234/5678';\n      resolve: https://doi.org/10.1234/5678;\n    }\n  */\n});\n\nconst dois = PublicationIds.parseDoi('10.1234/5678')\ndois.map(doi =\u003e {\n  console.log(doi);\n  /*\n    {\n      source: '10.1234/5678';\n      isValid: true;\n      doi: '10.1234/5678';\n      resolve: https://doi.org/10.1234/5678;\n    }\n  */\n\n  // Due to the nature of the DOI system, it is not possible to validate a DOI without resolving it.\n  fetch(doi.resolve)\n    .then(response =\u003e response.ok)\n});\n\nconst isbns = PublicationIds.parseIsbn('978-3-16-148410-0');\nisbns.map(isbn =\u003e {\n  console.log(isbn);\n  /*\n    {\n      source: '978-3-16-148410-0',\n      isValid: true,\n      isbn10: '3161484100',\n      isbn13: '9783161484100',\n    }\n  */\n\n // ISBNs can be validated without resolving them, due to a checksum in the ISBN.\n});\n\nconst issns = PublicationIds.parseIssn('0378-5955');\nissns.map(issn =\u003e {\n  console.log(issn);\n  /*\n    {\n      source: '0378-5955',\n      isValid: true,\n      issn: '03785955',\n    }\n  */\n\n // ISSNs can be validated without resolving them, due to a checksum in the ISBN.\n});\n\n// PMIDs and PMCIDs can be parsed using the same function.\nconst pmids = PublicationIds.parsePmid('PMC123456')\npmids.map(pmid =\u003e {\n  console.log(pmid);\n  /*\n    {\n      source: 'PMC123456';\n      isValid: true;\n      pmid: 'PMC123456';\n      resolve: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC123456/;\n    }\n  */\n\n  // Due to the nature of the PMID \u0026 PMCID system, it is not possible to validate a DOI without resolving it.\n  fetch(doi.resolve)\n    .then(response =\u003e response.ok)\n});\n```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnothingrandom%2Fpublication-ids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnothingrandom%2Fpublication-ids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnothingrandom%2Fpublication-ids/lists"}