@zingle/redisdrop

0.0.1 • Public • Published

Redis Dropbox: redisdrop

Create a function to drop files into a Redis list.

Example

const fs = require("fs");
const s3drop = require("redisdrop");
const endpoint = "redis://localhost:6379";
const keyspace = "dropbox:";
const filename = "my-file.txt";
const sender = "jdoe";
const keyfield = "sender"
const file = fs.createReadStream(filename);

// create drop function for redis list
const drop = redisdrop(endpoint, {keyspace, keyfield});

// set arbitrary metadata
const metadata = {filename, sender};

// use drop function to store file to S3
drop(file, metadata).then(key => {
    console.log(`saved attachment to '${key}' list at endpoint ${endpoint}`);
}).catch(err => {
    console.error(err.message);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @zingle/redisdrop

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

3.44 kB

Total Files

5

Last publish

Collaborators

  • njovin
  • oleksandr.vladymyrov
  • rremer
  • lmedrano
  • llongo-medallia