bob-ross-client
v1.0.2
Published
A javascript client for Bob Ross image servers.
Downloads
2
Readme
Bob Ross Client
A javascript client for Bob Ross image servers. Generates URLs and image source sets for retrieving images.
Installation
$ yarn add bob-ross-client
Implementation
import BobRossClient from 'bob-ross-client'
import hmacs from './hmacs.json'
const client = new BobRossClient({
serverUrl: process.env.BOB_ROSS_SERVER_URL,
hmacs
})
Usage
The Bob Ross client has two methods: client.getUrl
and client.getSrcset
. Both methods take the image hash and options as parameters. For more information on which keys the options object takes refer to the Bob Ross documentation.
const imageUrl = client.getUrl('abc123', {
resize: '300x225*',
...
})
const imageSrcset = client.getSrcset('abc123', {
resize: '300x225*',
...
})
Resources
Credits
All credits go to Jon and James Bracy.