# @stoplight/json-ref-readers

> Set of utilities for reading external json references

Latest version **1.2.2** (published 2021-02-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @stoplight/json-ref-readers
pnpm add @stoplight/json-ref-readers
yarn add @stoplight/json-ref-readers
bun add @stoplight/json-ref-readers
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2021-02-15 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.3.0 |
| Dependencies | 2 |
| Unpacked size | 15.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Stoplight |
| Maintainers | amjcraft, marbemac, pytlesk4, vazha, dcbachi, chohmann, lottamus, chris.miaskowski, wmhilton, philsturgeon, mallachari, stefandywersant, p0lip, paulatulis, mmiask, falsaffa_stoplight, zee-hussain, marcelltoth, naumanali__, mpodlasin, domagojk, jharmn |

## Links

- npm: https://www.npmjs.com/package/@stoplight/json-ref-readers
- Repository: https://github.com/stoplightio/json-ref-readers
- Homepage: https://github.com/stoplightio/json-ref-readers#readme
- Issues: https://github.com/stoplightio/json-ref-readers/issues
- npm.io page: https://npm.io/package/@stoplight/json-ref-readers

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.14.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Recent versions

- 1.2.2 (latest) — 2021-02-15
- 1.2.1 — 2020-07-09
- 1.1.1 — 2019-11-20

## README

# json-ref-readers
Set of utilities for reading external json references.

## Installation

```bash
yarn add @stoplight/json-ref-readers
```

## Usage

The library exports two functions: `resolveHttp` and `resolveFile`. Both take `uri.URI` and resolve to a string containing requested resource.

```ts
import { Resolver } from '@stoplight/json-ref-resolver';
import { resolveFile, resolveHttp } from '@stoplight/json-ref-readers';

const httpAndFileResolver = new Resolver({
  resolvers: {
    https: { resolve: resolveHttp },
    http: { resolve: resolveHttp },
    file: { resolve: resolveFile },
  },
});
```

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