1.2.0 • Published 6 years ago

json-feed-fetcher v1.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Fetch json data from an endpoint and returns an array of objects or a single object filtered against scheme. All properties key name are coverted to lowercase.

Install:

npm install json-feed-fetcher

run test:

npm test

Example code:

const jsonDataFetch = require('json-feed-fetcher')

const vesselSchema = {
  required: true,
  type: 'object',
  properties: {
    mmsi: {type: 'string', required: true},
    name: {type: 'string', required: true},
    rs: {type: 'string', required: true},
    state: {type: 'string', required: true},
    email: {type: 'string', required: true},
    mobile: {type: 'string', required: true},
    station: {
      required: true,
      type: 'object',
      properties: {
        name: {type: 'string', required: true},
        region: {type: 'string', required: true}
      },
      additionalProperties: false
    }
  },
  additionalProperties: false
}


jsonDataFetch('http://myendpoint', schema).then(data => {
  console.log(data)
})
1.2.0

6 years ago

1.1.0

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago