{"id":21198569,"url":"https://github.com/natlibfi/oai-pmh-client-js","last_synced_at":"2025-07-10T06:30:35.236Z","repository":{"id":57129435,"uuid":"267816823","full_name":"NatLibFi/oai-pmh-client-js","owner":"NatLibFi","description":"OAI-PMH Javascript client library","archived":false,"fork":false,"pushed_at":"2025-05-28T14:15:59.000Z","size":1044,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-20T14:58:10.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/NatLibFi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-29T09:20:23.000Z","updated_at":"2025-05-21T09:31:20.000Z","dependencies_parsed_at":"2025-01-08T12:23:51.296Z","dependency_job_id":"a737b668-3493-46b9-9fd7-a480bc09343a","html_url":"https://github.com/NatLibFi/oai-pmh-client-js","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/NatLibFi/oai-pmh-client-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Foai-pmh-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Foai-pmh-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Foai-pmh-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Foai-pmh-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NatLibFi","download_url":"https://codeload.github.com/NatLibFi/oai-pmh-client-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Foai-pmh-client-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264538580,"owners_count":23624436,"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":"2024-11-20T19:52:24.750Z","updated_at":"2025-07-10T06:30:35.231Z","avatar_url":"https://github.com/NatLibFi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAI-PMH Javascript client library [![NPM Version](https://img.shields.io/npm/v/@natlibfi/oai-pmh-client.svg)](https://npmjs.org/package/@natlibfi/oai-pmh-client)\n\n# Usage\n## Retrieve all records\n```js\nimport createClient from '@natlibfi/oai-pmh-client';\nconst client = createClient({url: 'https://foo.bar', metadataPrefix: 'marc'});\n\nclient.listRecords()\n  .on('record', record =\u003e processRecord(string))\n  .on('end', () =\u003e endProcessing())\n  .on('error', err =\u003e handleError(err));\n```\n## Retrieve records only from the first response\n```js\nimport createClient from '@natlibfi/oai-pmh-client';\nconst client = createClient({url: 'https://foo.bar', metadataPrefix: 'marc', retrieveAll: false});\n\nclient.listRecords()\n  .on('record', record =\u003e processRecord(string))\n  .on('end', resumptionToken =\u003e endProcessing(resumptionToken))\n  .on('error', err =\u003e handleError(err));\n```\n\nAnd then use the returned resumption token:\n```js\nclient.listRecords({resumptionToken})\n  .on('record', record =\u003e processRecord(string))\n  .on('end', resumptionToken =\u003e endProcessing(resumptionToken))\n  .on('error', err =\u003e handleError(err));\n```\n\nIf you need oai-pmh responses\n```js\nclient.listRecords()\n  .on('oaiPmhResponse', responseText =\u003e processResponse(responseText));\n```\n\n\n# Configuration\n## Client creation options\n- **url**: The URL of the OAI-PMH service.\n- **metadataPrefix**: Metadata prefix to use. **Mandatory**.\n- **set**: Set to use.\n- **metadataFormat**: Format of the metadata argument in **record** event. Defaults to **string** (See export **metadataFormats**)\n- **retrieveAll**: Whether to retrieve all records or just from the first response. If **false**, the **end** event returns the resumptionToken.\n- **filterDeleted**: Whether to filter out deleted records. Defaults to **false**.\n## listRecords options:\n- **metadataPrefix**: Override default metadata prefix.\n- **set**: Override default set.\n- **resumptionToken**: Resumption to use to resume the harvesting from.\n## Cli env options\n- **Check example.env**\n\n## License and copyright\n\nCopyright (c) 2020, 2023-2025 **University Of Helsinki (The National Library Of Finland)**\n\nThis project's source code is licensed under the terms of **MIT** or any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlibfi%2Foai-pmh-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatlibfi%2Foai-pmh-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlibfi%2Foai-pmh-client-js/lists"}