# jsonapi-typescript

> TypeScript definitions for JSON-API

Latest version **0.1.3** (published 2019-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsonapi-typescript
pnpm add jsonapi-typescript
yarn add jsonapi-typescript
bun add jsonapi-typescript
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-04-10 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 285.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mike North |
| Maintainers | northm |
| Keywords | jsonapi, typescript, ember-data, emberjs |

## Links

- npm: https://www.npmjs.com/package/jsonapi-typescript
- Repository: https://github.com/mike-north/jsonapi-typescript
- Homepage: https://github.com/mike-north/jsonapi-typescript#readme
- Issues: https://github.com/mike-north/jsonapi-typescript/issues
- npm.io page: https://npm.io/package/jsonapi-typescript

## Dependencies (1)

- [json-typescript](https://npm.io/package/json-typescript.md) ^1.0.0

## 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.1.3 (latest) — 2019-04-10
- 0.1.2 — 2019-04-10
- 0.1.0 — 2018-11-07
- 0.0.9 — 2018-07-04
- 0.0.8 — 2018-01-19
- 0.0.7 — 2018-01-11
- 0.0.6 — 2018-01-11

## README

# JSONAPI-typescript

[![Build Status](https://travis-ci.org/mike-north/jsonapi-typescript.svg?branch=master)](https://travis-ci.org/mike-north/jsonapi-typescript)
[![Version](https://img.shields.io/npm/v/jsonapi-typescript.svg)](https://www.npmjs.com/package/jsonapi-typescript)

TypeScript type information for compile-time validation of [JSON:API documents](https://www.jsonapi.org/). Supports TS 2.3 and above.

## How to use this

1. Install this package
```js
npm install --save-dev jsonapi-typescript
```

2. Import this module
```ts
import * as JSONAPI from 'jsonapi-typescript';
```

3. check to see if json types are validated correctly

```ts
import * as JSONAPI from 'jsonapi-typescript';

// ✅ This should be OK
let doc: JSONAPI.Document = {
  data: {
    type: 'articles',
    id: '1'
  }
};

// ⛔️ This should NOT be OK ("result" is not a valid JSON:API top-level key)
let doc: JSONAPI.Document = {
  result: "Success!"
};

// ⛔️ This should NOT be OK ( empty Array is not a valid JSON:API document )
let doc: JSONAPI.Document = [];
```

## Copyright
&copy; 2017 [Mike North](https://github.com/mike-north), All Rights Reserved.

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