# get-json

> Cross-platform library for getting JSON docs

Latest version **1.1.0** (published 2024-06-17) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install get-json
pnpm add get-json
yarn add get-json
bun add get-json
```

## 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.1.0 |
| Published | 2024-06-17 |
| First published | 2013-04-03 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 3 |
| Unpacked size | 12.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | azer |
| Maintainers | zeke, ljharb |
| Keywords | JSON, fetch, getJSON |

## Links

- npm: https://www.npmjs.com/package/get-json
- Repository: https://github.com/ljharb/get-json
- Homepage: https://github.com/ljharb/get-json#readme
- Issues: https://github.com/ljharb/get-json/issues
- npm.io page: https://npm.io/package/get-json

## Dependencies (3)

- [jsonp](https://npm.io/package/jsonp.md) ^0.2.1
- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.2.1
- [safe-regex-test](https://npm.io/package/safe-regex-test.md) ^1.0.3

## 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

- 1.1.0 (latest) — 2024-06-17
- 1.0.2 — 2024-06-14
- 1.0.1 — 2018-10-07
- 1.0.0 — 2017-08-17
- 0.0.3 — 2016-04-19
- 0.0.1-security — 2016-03-23
- 2.0.0 — 2016-03-22
- 0.0.2 — 2014-06-18
- 0.0.1 — 2013-08-14
- 0.0.0 — 2013-04-03

## README

## get-json

Cross-platform library for getting JSON documents. Wraps [request](http://npmjs.org/request) on Node, fallsback to [JSONP](http://github.com/webmodules/jsonp) on browsers.

```bash
$ npm install get-json
```

## Usage

```js
var getJSON = require('get-json')

getJSON('http://api.listenparadise.org', function(error, response){

    console.log(error);
    // undefined

    console.log(response);
    // ["Beth Orton &mdash; Stolen Car",
    // "Jack White &mdash; Temporary Ground",
    // "I Am Kloot &mdash; Loch",
    // "Portishead &mdash; Glory Box"]
});
```

Alternatively, you can use a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises):

```js
var getJSON = require('get-json')

getJSON('http://api.listenparadise.org')
    .then(function(response) {
      console.log(response);
    }).catch(function(error) {
      console.log(error);
    });
```

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