# smartapi-parser

> a nodejs library for parsing smartapi specifications

Latest version **1.3.9** (published 2021-02-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install smartapi-parser
pnpm add smartapi-parser
yarn add smartapi-parser
bun add smartapi-parser
```

## 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.3.9 |
| Published | 2021-02-09 |
| First published | 2020-05-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 34 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jiwen xin |
| Maintainers | kevinxin |
| Keywords | smartapi |

## Links

- npm: https://www.npmjs.com/package/smartapi-parser
- Repository: https://github.com/kevinxin90/smartapi-parser
- Homepage: https://github.com/kevinxin90/smartapi-parser#readme
- Issues: https://github.com/kevinxin90/smartapi-parser/issues
- npm.io page: https://npm.io/package/smartapi-parser

## Dependencies (2)

- [husky](https://npm.io/package/husky.md) ^4.3.8
- [lodash](https://npm.io/package/lodash.md) ^4.17.15

## Recent versions

- 1.3.9 (latest) — 2021-02-09
- 1.3.8 — 2021-02-07
- 1.3.7 — 2021-02-07
- 1.3.6 — 2021-01-27
- 1.3.5 — 2021-01-27
- 1.3.4 — 2021-01-27
- 1.3.1 — 2020-12-18
- 1.3.0 — 2020-12-18
- 1.2.2 — 2020-12-07
- 1.2.1 — 2020-12-07
- 1.2.0 — 2020-12-07
- 1.1.0 — 2020-07-01
- 1.0.8 — 2020-06-08
- 1.0.7 — 2020-06-08
- 1.0.6 — 2020-05-28
- … 6 more at https://npm.io/package/smartapi-parser/versions

## README

# smartapi-parser

![Test Coveralls](https://github.com/kevinxin90/smartapi-parser/workflows/Test%20Coveralls/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/kevinxin90/smartapi-parser/badge.svg?branch=master)](https://coveralls.io/github/kevinxin90/smartapi-parser?branch=master)
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.svg?v=101)](https://github.com/ellerbrock/typescript-badges/)
![npm](https://img.shields.io/npm/v/smartapi-parser)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/smartapi-parser)
![npm](https://img.shields.io/npm/dm/smartapi-parser)


A NodeJS library for parsing SmartAPI specifications

## Install

```
$ npm install smartapi-parser
```

## Usage
The package requires SmartAPI specification in JSON format as its input. You can use *fs* or API fetch libraries such as *node-fetch*, *axios* to load a SmartAPI file from local or remote desitiniations.
```js
const parser = require('smartapi-parser');
// need to install node-fetch libary first using npm i node-fetch
const fetch = require('node-fetch');

fetch('https://smart-api.info/api/metadata/81955d376a10505c1c69cd06dbda3047')
    .then(response => response.json())
    .then(spec => {
        let api = new parser(spec);
        console.log(api.metadata);
	});
	
	// // {
	// 	"title": "SEMMED Gene API",
	// 	"tags": ["disease", "annotation", "query", "translator", "biothings", "semmed"],
	// 	"url": "https://biothings.ncats.io/semmedgene",
	// 	"operations": [
	// 		"query_operation": ...,
	// 		"association": ...,
	// 		"response_mapping": ...,
	// 		"id": ...
	// 	]
	// // }
```



## Related

- [@biothings-explorer/smartapi-kg](https://github.com/kevinxin90/smartapi-kg.js) - Organize SmartAPI Specifications into a meta knowledge graph.

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