# @canner/canner-functions

> canner-functions

Latest version **0.4.0** (published 2017-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @canner/canner-functions
pnpm add @canner/canner-functions
yarn add @canner/canner-functions
bun add @canner/canner-functions
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2017-10-13 |
| First published | 2017-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | abz53378, wwwy3y3, ctxhou, chilijung |

## Links

- npm: https://www.npmjs.com/package/@canner/canner-functions
- npm.io page: https://npm.io/package/@canner/canner-functions

## Dependencies (8)

- [koa](https://npm.io/package/koa.md) ^2.3.0
- [boom](https://npm.io/package/boom.md) ^5.2.0
- [kcors](https://npm.io/package/kcors.md) ^2.2.1
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.0
- [koa-cors](https://npm.io/package/koa-cors.md) ^0.0.16
- [koa-router](https://npm.io/package/koa-router.md) ^7.2.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^1.7.1
- [@canner/canner-api](https://npm.io/package/@canner/canner-api.md) ^0.0.16

## Recent versions

- 0.4.0 (latest) — 2017-10-13
- 0.3.0 — 2017-09-28
- 0.2.0 — 2017-09-21
- 0.1.2 — 2017-08-09
- 0.1.1 — 2017-07-28
- 0.1.0 — 2017-07-28
- 0.0.4 — 2017-07-26
- 0.0.3 — 2017-07-26
- 0.0.1 — 2017-07-26

## README

## canner functions
### array
``` js
const functions = require('@canner/canner-functions');

exports.validateOrder = functions.database.array('/orders').beforeCreate(({data, Errors}) => {
    return validate(data)
    .catch(err => throw Errors.forbidden());
})
```

### object
``` js
const functions = require('@canner/canner-functions');

exports.updateTitle = functions.database.object('/brand/location').afterUpdate(({newData, database}) => {
    return database.object('/brand/title').set(`address: ${newData.address}`);
})
```

### https
``` js
const functions = require('@canner/canner-functions');

exports.getPrice = functions.https.post('/price', ({req, res}) => {
    res.send("price");
})
```

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