Socket
Book a DemoInstallSign in
Socket

@nxcd/barkeeper

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nxcd/barkeeper

A middleware express for handling multipart/form-data to redis

latest
npmnpm
Version
4.10.0
Version published
Maintainers
2
Created
Source

Barkeeper

Barkeeper is a express middleware for handling multipart/form-data and persist in redis, which is used for uploading files to redis.

Basic Usage

Install:

$ npm i @nxcd/barkeeper

Import and use:

const redis = require('redis')
const express = require('express')

// Import barkeeper
const { Barkeeper } = require('@nxcd/barkeeper')

const redisClient = redis.createClient({ return_buffers: true }) // To save

const config = {
  ttl: 360 // Time to redis key expire in seconds
}

const barkeeper = barkeeperFactory(redisClient, config)

const app = express()

app.post('/file', barkeeper.upload({}), (req, res, next) => {
  // req.files is an array of files
})

API

Files information

Files contains an array of objects, each file contains the following information:

KeyDescription
keyKey to identify in redis
fieldnameField name specified in the form
nameName of the file on the user's computer
encodingEncoding type of the file
mimetypeMime type of the file

Keywords

redis

FAQs

Package last updated on 24 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.