# ajv-keyword-dynamic-defaults

> Partial implementation of ajv-keywords

Latest version **0.0.1** (published 2018-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ajv-keyword-dynamic-defaults
pnpm add ajv-keyword-dynamic-defaults
yarn add ajv-keyword-dynamic-defaults
bun add ajv-keyword-dynamic-defaults
```

## 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.0.1 |
| Published | 2018-01-11 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | geraldhart100 |

## Links

- npm: https://www.npmjs.com/package/ajv-keyword-dynamic-defaults
- npm.io page: https://npm.io/package/ajv-keyword-dynamic-defaults

## Dependencies (2)

- [ava](https://npm.io/package/ava.md) ^0.24.0
- [yiwn-shortid](https://npm.io/package/yiwn-shortid.md) 0.0.1

## Recent versions

- 0.0.1 (latest) — 2018-01-11

## README

# ajv-keyword-dynamic-defaults

Partial implementation of [ajv-keywords](https://github.com/epoberezkin/ajv-keywords)

## Install

```sh
npm install ajv-keyword-dynamic-defaults
```

## Example

```js
const schema = {
  type: 'object',
  dynamicDefaults: {
    ts: 'datetime'
  },
  properties: {
    ts: {
      type: 'string',
      format: 'datetime'
    }
  }
}

const data = {}
ajv.validate(data) // true
data // { ts: '2016-12-01T22:07:28.829Z' }

const data1 = {}
ajv.validate(data1) // true
data1 // { ts: '2016-12-01T22:07:29.832Z' }

ajv.validate(data1) // true
data1 // didn't change, as all properties were defined
```

## Methods

- `"timestamp"` - current timestamp in milliseconds
- `"datetime"` - current date and time as string (ISO, valid according to date-time format)
- `"date"` - current date as string (ISO, valid according to date format)
- `"time"` - current time as string (ISO, valid according to time format)
- `"shortid"` - unique random string

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