1.3.9 • Published 3 years ago

smartapi-parser v1.3.9

Weekly downloads
105
License
ISC
Repository
github
Last release
3 years ago

smartapi-parser

Test Coveralls Coverage Status TypeScript npm npm bundle size npm

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.

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

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago