# schm-computed

> Adds computed parameters to schm schemas

Latest version **0.4.1** (published 2018-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install schm-computed
pnpm add schm-computed
yarn add schm-computed
bun add schm-computed
```

## 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.4.1 |
| Published | 2018-09-10 |
| First published | 2017-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 511 |
| Author | Diego Haz |
| Maintainers | diegohaz |
| Keywords | schm, computed |

## Links

- npm: https://www.npmjs.com/package/schm-computed
- Repository: https://github.com/diegohaz/schm/tree/master/packages/schm-computed
- npm.io page: https://npm.io/package/schm-computed

## Recent versions

- 0.4.1 (latest) — 2018-09-10
- 0.1.6 — 2018-06-12
- 0.1.5 — 2018-03-22
- 0.1.4 — 2018-03-10
- 0.1.3 — 2018-03-05
- 0.1.2 — 2018-02-16
- 0.1.1 — 2018-01-20
- 0.1.0 — 2018-01-13
- 0.0.7 — 2017-06-19
- 0.0.6 — 2017-06-12

## README

# schm-computed

[![NPM version](https://img.shields.io/npm/v/schm-computed.svg?style=flat-square)](https://npmjs.org/package/schm-computed)

Adds computed parameters to `schm` schemas.

## Install

    $ npm install --save schm-computed

## Usage

```js
const schema = require('schm')
const computed = require('schm-computed')

const userSchema = schema({
  firstName: String,
  lastName: String,
}, computed({
  fullName: values => `${values.firstName} ${values.lastName}`,
}))

userSchema.parse({
  firstName: 'Diego',
  lastName: 'Haz'
})
```

Output:

```js
{
  firstName: 'Diego',
  lastName: 'Haz',
  fullName: 'Diego Haz'
}
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [computed](#computed)
    -   [Parameters](#parameters)

### computed

Add computed parameters to schema.

#### Parameters

-   `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

## License

MIT © [Diego Haz](https://github.com/diegohaz)

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