JavaScript client for Centers for Medicare & Medicaid Services Data API
npm i cmsdata-client
const { createClient } = require('cmsdata-client');
const client = createClient('b8b0419c-3025-4738-8787-ed40c9e0816d');
const result = await client.get();
// check for error
if (result.error) {
console.error(result.error);
}
// data
console.log(dataset.data);
// metadata
console.log(dataset.metadata);
-
createClient:
dataset id
:string
, requiredoptions
:object
, optionaloutput
:string
-
get:
- returns dataset, metadata, and error messages if any
{ data: {}, metadata: {}, err: "" }
More information on the Drupal JSON:API module
- Fork it.
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request