# @eqworks/cen-node

> CEN API implementation in Node.js.

Latest version **0.2.2** (published 2020-04-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @eqworks/cen-node
pnpm add @eqworks/cen-node
yarn add @eqworks/cen-node
bun add @eqworks/cen-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2020-04-28 |
| First published | 2020-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | catherinezhang, dilshaneq, goondrious, kevlabs, woozyking |

## Links

- npm: https://www.npmjs.com/package/@eqworks/cen-node
- npm.io page: https://npm.io/package/@eqworks/cen-node

## Recent versions

- 0.2.2 (latest) — 2020-04-28
- 0.2.1 — 2020-04-15
- 0.2.0 — 2020-04-14
- 0.1.1 — 2020-04-08
- 0.1.0 — 2020-04-08

## README

# CEN-node

TCN (CEN) API implementation in Node.js.

WIP, referencing [https://github.com/Co-Epi/coepi-backend-aws](https://github.com/Co-Epi/coepi-backend-aws)

```shell
% yarn add @eqworks/cen-node

# or

% npm install @eqworks/cen-node
```

## utils

## middleware

Express.js compatible HTTP middleware

```js
const express = require('express')
const { postReportReq, postReport } = require('@eqworks/cen-node')

// your own report persistence implementation
const { saveReport } = require('./db')

const app = express()
app.use(express.json())

app.post(['/tcnreport', '/cenreport'],
  // middleware to perform preliminary validations
  postReportReq,
  // middleware to populate req._cen
  // with a body of { report, reportID }
  postReport,
  // your own report persistence routine and response handler
  (req, res, next) => {
    saveReport(req._cen)
      .then(() => res.sendStatus(200))
      .catch(next)
  }
)
```

---
_Source: https://npm.io/package/@eqworks/cen-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
