keysrun
v1.0.3
Published
SDK for keys.run
Downloads
4
Readme
Keys.run
Keys.run is a blazing fast, dead simple key-value API.
Get started
Install the npm module using:
npm install keysrun --save
Save a get
const keys = require('keysrun')
keys.init('YOUR_API_KEY')
keys.set('highscore', 3000).then(_ => {
console.log(`New high score is saved!`)
})
Get a get
const keys = require('keysrun')
keys.init('YOUR_API_KEY')
keys.get('highscore').then(highscore => {
console.log(`The current highscore is ${highscore}`)
})
Scoping
Let's say your want to have different keys for your production environment and dev environment, but having the same.
All you have to do is keys.namespace('dev')
.
Example:
const keys = require('keysrun')
keys.init('YOUR_API_KEY')
keys.namespace('production')
// This will actually set the key 'production/highscore'
keys.get('highscore').then(highscore => {
console.log(`The current highscore is ${highscore}`)
})