1.2.0 • Published 7 years ago

json-feed-fetcher v1.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
7 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

7 years ago

1.1.0

7 years ago

1.0.14

7 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago