| # @citation-js/plugin-doi | |
| Plugin for DOI input for Citation.js. | |
| [](https://npmjs.org/package/@citation-js/plugin-doi) | |
| [](https://npmcharts.com/compare/@citation-js%2Fplugin-doi?minimal=true) | |
|  | |
|  | |
| --- | |
| ## Install | |
| npm install @citation-js/plugin-doi | |
| ## Usage | |
| Register by importing the package: | |
| ```js | |
| require('@citation-js/plugin-doi') | |
| ``` | |
| ### 'Polite' API access | |
| The plugin fetches data from DOIs using [DOI Content Negotiation](https://citation.crosscite.org/docs), | |
| which means the Crossref, DataCite, and mEDRA APIs are indirectly used. | |
| [Crossref strongly encourages](https://api.crossref.org/swagger-ui/index.html) | |
| adding a `mailto:` link to the `User-Agent` header or URL parameters | |
| to get higher rate limits. Because the Crossref API is only used indirectly, | |
| the URL parameter method cannot be used consistently. Additionally, the `User-Agent` | |
| header cannot be set in the browser. For non-browser usage however, | |
| the user agent can be set like this: | |
| ```js | |
| const { util, version } = require('@citation-js/core') | |
| util.setUserAgent(`Example Foo (mailto:foo@example.org) Citation.js/${version} Node.js/${process.versions.node}`) | |
| ``` | |
| ## Formats | |
| Formats and other features added by this plugin. | |
| ### Input | |
| Supports DOIs inputted in the following ways: | |
| * `@doi/api`: a `doi.org` URL | |
| * `@doi/id`: a single DOI | |
| * `@doi/list+text`: whitespace-separated list of DOIs | |
| * `@doi/list+object`: array of DOIs | |
| Additionally, the following internal type is exposed: | |
| * `@doi/type`: fix the `type` value in certain API responses | |
Xet Storage Details
- Size:
- 1.85 kB
- Xet hash:
- 8651ef8ca7835b584bfcea8962deec4e536fee80e23cce32638dd6a38dbea51d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.