# tcomb-property

> Alternative syntax for defining default props in tcomb structures

Latest version **1.0.0** (published 2016-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install tcomb-property
pnpm add tcomb-property
yarn add tcomb-property
bun add tcomb-property
```

## 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.0 |
| Published | 2016-11-18 |
| First published | 2016-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ewnd9 |
| Maintainers | ewnd9 |
| Keywords | tcomb |

## Links

- npm: https://www.npmjs.com/package/tcomb-property
- Repository: https://github.com/ewnd9/tcomb-property
- Homepage: https://github.com/ewnd9/tcomb-property#readme
- Issues: https://github.com/ewnd9/tcomb-property/issues
- npm.io page: https://npm.io/package/tcomb-property

## Dependencies (1)

- [merge](https://npm.io/package/merge.md) ^1.2.0

## Recent versions

- 1.0.0 (latest) — 2016-11-18

## README

# tcomb-property

[![Build Status](https://travis-ci.org/ewnd9/tcomb-property.svg?branch=master)](https://travis-ci.org/ewnd9/tcomb-property)

Alternative syntax for defining default props in tcomb structures

## Install

```sh
$ npm install --save tcomb-property
```

## Usage

```js
import t from 'tcomb';
import { property, createInstance } from 'tcomb-property';

const Show = t.struct({
  title: t.String,
  duration: property(t.String, '40m'),
  network: t.struct({
    country: property(t.String, 'USA')
  })
});

createInstance(Show)
/*
{
  title: undefined,
  duration: '40m',
  network: {
    country: 'USA'
  }
}
*/

createInstance(Show, { title: 'Top Gear', duration: '20m', network: { country: 'UK' } })
/*
{
  title: 'Top Gear',
  duration: '20m',
  network: {
    country: 'UK'
  }
}
*/
```

## Related

- [tcomb](https://github.com/gcanti/tcomb/blob/bdd7112314fc1e25880e4e94e2297ff52a0b4817/docs/API.md#the-struct-combinator)
- [tcomb-defaults](https://github.com/ahdinosaur/tcomb-defaults)

## License

MIT © [ewnd9](http://ewnd9.com)

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