https://github.com/trialanderrororg/csl-consolidate
Small utility script which checks a list of CSL references against the Crossref doi.
https://github.com/trialanderrororg/csl-consolidate
citations crossref csl doi metadata references typescript
Last synced: 2 months ago
JSON representation
Small utility script which checks a list of CSL references against the Crossref doi.
- Host: GitHub
- URL: https://github.com/trialanderrororg/csl-consolidate
- Owner: TrialAndErrorOrg
- Created: 2023-02-28T21:58:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-29T14:53:33.000Z (over 2 years ago)
- Last Synced: 2025-01-01T04:52:43.877Z (over 1 year ago)
- Topics: citations, crossref, csl, doi, metadata, references, typescript
- Language: TypeScript
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
> **Note**
> This repository is automatically generated from the [main parser monorepo](https://github.com/TrialAndErrorOrg/parsers). Please submit any issues or pull requests there.
## API
***
### `consolidate()`
Try to resolve a list of CSL data with crossref metadata
#### Signature
```ts
consolidate(data: Data[], options: object): Promise;
```
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | `Data`[] |
| `options` | `object` |
| `options.mailto` | `string` |
#### Returns
`Promise`<`undefined` | `Data`[]>
Defined in: [lib/csl-consolidate.ts:12](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/citations/csl-consolidate/src/lib/csl-consolidate.ts#L12)
***
### `dateSim()`
#### Signature
```ts
dateSim(ref: Data, csl: Data): number;
```
#### Parameters
| Name | Type |
| :------ | :------ |
| `ref` | `Data` |
| `csl` | `Data` |
#### Returns
`number`
Defined in: [lib/csl-consolidate.ts:144](https://github.com/TrialAndErrorOrg/parsers/blob/main/libs/citations/csl-consolidate/src/lib/csl-consolidate.ts#L144)
## Install
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install as
```bash
pnpm add csl-consolidate
# or with yarn
[](https://badge.fury.io/js/csl-consolidate) [](https://www.npmjs.com/package/csl-consolidate)
# yarn add csl-consolidate
# or with npm
# npm install csl-consolidate
```
# citations-csl-consolidate
Small utility script which checks a list of CSL references against the Crossref doi.
If possible it adds the missing DOIs and extra metadata provided by Crossref or the doi provider.