# ajd

> Another JSON dereferencer, based on ajv.

Latest version **0.1.1** (published 2017-04-22) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install ajd
pnpm add ajd
yarn add ajd
bun add ajd
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-04-22 |
| First published | 2017-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 5.0.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ira Miller |
| Maintainers | isysd |

## Links

- npm: https://www.npmjs.com/package/ajd
- Repository: https://github.com/isysd/ajd
- Issues: https://github.com/isysd/ajd/issues
- npm.io page: https://npm.io/package/ajd

## Dependencies (2)

- [ajv](https://npm.io/package/ajv.md) ^5.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 0.1.1 (latest) — 2017-04-22

## README

# Ajd [![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) [![Build Status](https://secure.travis-ci.org/isysd/ajd.png?branch=master)](https://travis-ci.org/isysd/ajd) [![NPM version](https://img.shields.io/npm/v/ajd.svg)](http://badges.enytc.com/for/npm/ajd) [![Coverage Status](https://coveralls.io/repos/github/isysd/ajd/badge.svg?branch=master)](https://coveralls.io/github/isysd/ajd?branch=master)

> Another JSON dereferencer, based on ajv.

A fast and simple JSON dereferencer for JSON schema draft 06. Leaves circular references in place for speed and accuracy. Uses [ajv](https://github.com/epoberezkin/ajv) for caching.

 + http(s):// references
 + file:// references
 + local pointers (#\*)

Returns a Promise.

## Install

Install `ajd`:

```bash
$ npm i --save ajd
```

### Usage

Create a new folder for your project:

##### HTTP ref

```
ajd({'$ref': 'https://iramiller.com/schema.json'}).then(function (schema, err) {
  console.log(schema) // dereffed schema contents
})
```

##### Circular ref

```
ajd({
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "circle.circle#",
  "title": "A circular schema",
  "properties": {
    "additionalItems": {
      "$ref": "#"
    }
  }
}).then(function (schema, err) {
  console.log(require('circular-json').stringify(schema))
})
```

Will output:

```
{
 "$schema": "http://json-schema.org/draft-06/schema#",
 "$id": "circle.circle#",
 "title": "A circular schema",
 "properties": {
  "additionalItems": "~"
 }
}
```

##### Cached ajv

```
ajd({'$ref': '#/ajv/already/has/schema'}, ajv).then(function (schema, err) {
  console.log(schema) // dereffed schema contents
})
```

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