0.1.0 • Published 5 years ago
okraland v0.1.0
okraland
Ok ta R ate limit A PI L ibrary AND it uses highland too
Utility function used with Highland. Allows the Okta API to be consumed as a highland stream asyncronously while respecting rate limit headers.
Usage
Expects a Axios request. Will return a stream that emits Axios responses. If an error is encountered, it will be passed through the stream as an error.
const _ = require('highland')
const okraland = require('@articulate/okraland')
_([ 'userid1', 'userid2', 'userid3' ])
.map(id => ({
headers: { authorization: 'SSWS [API KEY]' }
method: 'GET',
url: `https://org.okta.tld/api/v1/users/${id}`,
}))
.flatMap(okraland())
.each(({ data }) => console.log('Fetched user', data))
Etymology
Is Jasmina Jacquelina's & Robert Pearce's fault.
0.1.0
5 years ago