# 1tree-schema

> Convert JSON schema to and from 1tree instances

Latest version **0.2.5** (published 2017-03-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install 1tree-schema
pnpm add 1tree-schema
yarn add 1tree-schema
bun add 1tree-schema
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2017-03-09 |
| First published | 2017-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nik Coughlin |
| Maintainers | andybell, nrkn |
| Keywords | 1tree, JSON, schema |

## Links

- npm: https://www.npmjs.com/package/1tree-schema
- Repository: https://github.com/mojule/1tree-schema
- Homepage: https://github.com/mojule/1tree-schema#readme
- Issues: https://github.com/mojule/1tree-schema/issues
- npm.io page: https://npm.io/package/1tree-schema

## Dependencies (2)

- [1tree](https://npm.io/package/1tree.md) ^0.4.14
- [1tree-factory](https://npm.io/package/1tree-factory.md) ^0.1.15

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.5 (latest) — 2017-03-09
- 0.2.4 — 2017-02-16
- 0.2.3 — 2017-02-09
- 0.2.1 — 2017-02-08
- 0.2.0 — 2017-02-08
- 0.1.8 — 2017-01-25
- 0.1.7 — 2017-01-25
- 0.1.6 — 2017-01-25
- 0.1.5 — 2017-01-20
- 0.1.4 — 2017-01-20
- 0.1.3 — 2017-01-18
- 0.1.2 — 2017-01-17
- 0.1.1 — 2017-01-17
- 0.1.0 — 2017-01-16

## README

# 1tree-schema

Converts JSON schema to and from 1tree instances

```javascript
const SchemaTree = require( '1tree-schema' )
const jsonSchema = require( './test.schema.json' )

const tree = SchemaTree( jsonSchema )

const integerNodes = tree.findAll( n => n.nodeType() === 'integer' )

integerNodes.forEach( n => {
  const value = n.value()

  value.minimum = 1

  n.value( value )
})

const newSchema = tree.toSchema()

console.log( JSON.stringify( newSchema, null, 2 ) )
```

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