# @nhz.io/ref-resolve

> JSON references resolver

Latest version **1.0.2** (published 2016-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nhz.io/ref-resolve
pnpm add @nhz.io/ref-resolve
yarn add @nhz.io/ref-resolve
bun add @nhz.io/ref-resolve
```

## 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.2 |
| Published | 2016-09-10 |
| First published | 2016-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ishi Ruy |
| Maintainers | nhz.io |
| Keywords | ref-resolve, resolve, nhz.io |

## Links

- npm: https://www.npmjs.com/package/@nhz.io/ref-resolve
- Repository: https://github.com/nhz-io/ref-resolve
- Issues: https://github.com/nhz-io/ref-resolve/issues
- npm.io page: https://npm.io/package/@nhz.io/ref-resolve

## Dependencies (1)

- [@nhz.io/ref-node](https://npm.io/package/@nhz.io/ref-node.md) ^1.0.8

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-09-10
- 1.0.1 — 2016-09-10
- 1.0.0 — 2016-09-10

## README

<h1 align="center">@nhz.io/ref-resolve</h1>

<p align="center">
  <a href="https://npmjs.org/package/@nhz.io/ref-resolve">
    <img src="https://img.shields.io/npm/v/@nhz.io/ref-resolve.svg?style=flat"
         alt="NPM Version">
  </a>

  <a href="https://www.bithound.io/github/nhz-io/ref-resolve">
    <img src="https://www.bithound.io/github/nhz-io/ref-resolve/badges/score.svg"
         alt="Bithound Status">
  </a>

  <a href="https://github.com/nhz-io/ref-resolve/blob/master/LICENSE">
    <img src="https://img.shields.io/github/license/nhz-io/ref-resolve.svg?style=flat"
         alt="License">
  </a>

  <a href="https://npmjs.org/package/@nhz.io/ref-resolve">
  <img src="http://img.shields.io/npm/dm/@nhz.io/ref-resolve.svg?style=flat"
  alt="Downloads">
  </a>  
</p>

<h3 align="center">JSON references resolver<h2>

## Install
```
npm i -S @nhz.io/ref-resolve
```

## Example

### Successful reference resolution
```javascript
const resolve = require('@nhz.io/ref-resolve')
const result = resolve({
    a: {foo: 'FOO', bar: 'BAR'},
    b: {foo: '${a.foo}', bar: '${a.bar}'},
    c: '${a.foo}${b.bar}',
})
/* result = {
    a: { foo: 'FOO', bar: 'BAR' },
    b: { foo: 'FOO', bar: 'BAR' },
    c: 'FOOBAR',
} */
```

### Get unresolved references
```javascript
const resolve = require('@nhz.io/ref-resolve')
const unresolved = []
const result = resolve({
    a: {foo: 'FOO', bar: 'BAR'},
    b: {foo: '${a.FOO}', bar: '${a.BAR}'},
    c: '${a.FOO}${a.BAR}'
}, unresolved)
/* result = {
    a: { foo: 'FOO', bar: 'BAR' },
    b: {},
} */

/* unresolved = ['${a.FOO}', '${a.BAR}'] */

```

## License

### [MIT](LICENSE)

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