heroku-redis-flushall
v0.0.2
Published
Programmatically flushes all keys from a heroku redis instance.
Downloads
8
Readme
heroku-redis-flushall
Programmatically flushes all keys from a heroku redis instance.
Installation
npm install --save heroku-redis-flushall
flushall ({ apiKey, app })
Example
const flushall = require('heroku-redis-flushall')
flushall({ app: 'HEROKU_APP_NAME', apiKey: 'HEROKU_API_KEY' }).then(resp => {
console.log(resp)
// => {
// stdout: 'Connecting to redis-vertical-96543 (REDIS_URL):\n\nDisconnected from instance.',
// stderr: '',
// code: 0,
// failed: false,
// killed: false,
// signal: null,
// cmd: '/bin/sh -c echo " FLUSHALL\r\n QUIT" | heroku redis:cli -a heroku_app --confirm heroku_app',
// timedOut: false
// }
})
Auth
Either set process.env.HEROKU_API_KEY or pass your key as a param { apiKey: 'xxxxx' }
You can retrieve your heroku auth token by running:
heroku login # login if necessary
heroku auth:token