# doi-pmid-finder

> Find and validate all Doi(s), Pmid(s) on a string, returning a array of results.

Latest version **1.0.7** (published 2022-10-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install doi-pmid-finder
pnpm add doi-pmid-finder
yarn add doi-pmid-finder
bun add doi-pmid-finder
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-10-28 |
| First published | 2022-10-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | jcvb |
| Maintainers | jcvb |
| Keywords | pmid, doi, finder |

## Links

- npm: https://www.npmjs.com/package/doi-pmid-finder
- Repository: https://github.com/jcvb/doi-pmid-finder
- Homepage: https://github.com/jcvb/doi-pmid-finder.git
- Issues: https://github.com/jcvb/doi-pmid-finder/issues
- npm.io page: https://npm.io/package/doi-pmid-finder

## Dependencies (3)

- [core-js](https://npm.io/package/core-js.md) ^3.26.0
- [doi-regex](https://npm.io/package/doi-regex.md) ^0.1.13
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.1.5

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2022-10-28
- 1.0.6 — 2022-10-28
- 1.0.5 — 2022-10-27
- 1.0.4 — 2022-10-27
- 1.0.3-ubl — 2022-10-27
- 1.0.2 — 2022-10-25
- 1.0.1 — 2022-10-25
- 1.0.0 — 2022-10-25

## README

# doi-pmid-finder 


> Find and validate all Doi(s), Pmid(s) on a string, returning a array of results.


## Install

```sh
$ npm install doi-pmid-finder
```


## Usage

```js
const doiPmidFinder = require("doi-pmid-finder");

doiPmidFinder(
  "unicorn 10.1000/xyz000 10.1000/xyz000 10.1000/xyz000 10.1000/xyz000 https://onlinelibrary.wiley.com/doi/10.1111/all.14449  https://link.springer.com/article/10.1007/s10456-021-09805-6  5454454 34343 3333 12345 juan  4444 99999999999999999  0000 10.1186/s12879-021-06357-4 https://www.pnas.org/doi/full/10.1073/pnas.2203437119",
  { type: "single" }
).then((response) => {
  console.log(response);
});

```

## Config


### type

Type is optional, ussing type = "single" return the first pmid or doi that the library find.


## API

### doiPmidFinder(string)

Returns a array of doi(s) and pmid(s) removing all repeated ids. The pmid are validated on ncbi API (https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi)

#### Example 
```js
doiPmidFinder(
  "unicorn 10.1000/xyz000 10.1000/xyz000 10.1000/xyz000 10.1000/xyz000 https://onlinelibrary.wiley.com/doi/10.1111/all.14449  https://link.springer.com/article/10.1007/s10456-021-09805-6  5454454 34343 3333 12345 juan  4444 99999999999999999  0000 10.1186/s12879-021-06357-4 https://www.pnas.org/doi/full/10.1073/pnas.2203437119",
).then((response) => {
  console.log(response);
});

// Output response:

{
  data: {
    doiList: [
      '10.1000/xyz000',
      '10.1111/all.14449',
      '10.1007/s10456-021-09805-6',
      '10.1186/s12879-021-06357-4',
      '10.1073/pnas.2203437119'
    ],
    pmidList: [ '5454454', '34343', '3333', '12345', '4444' ]
  }
}

```

#### Example ussing type = "single"
```js
doiPmidFinder(
  "unicorn 56564 10.1000/xyz000",
  { type: "single" }
).then((response) => {
  console.log(response);
});

// Output response: 56564

```

---
_Source: https://npm.io/package/doi-pmid-finder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
