# `nist`

This module communicates with the official National Institute of Standards and Technology API, the folks who maintain the canonical CVE database.

More information about the API is available at [nist.gov](https://nvd.nist.gov/developers/start-here).

## Usage

### `cve(cveId: string): Promise<CVE | null>`

Returns a `CVE` object from the NIST API; `null` if not found.

```ts
import { NIST, type CVE } from "./src/connectors/nist";

const nist = new NIST({ apiToken: process.env.NIST_API_KEY });
const cve: CVE | null = await nist.cve("CVE-2019-1002101");

console.log(cve);
```

<sub>`console.log(cve)` matches [`CVE-2019-1002101.json`](<(./__tests__/__payloads__/CVE-2019-1002101.json)>)</sub>
