4.10.0 • Published 11 months ago
@nxcd/barkeeper v4.10.0
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:
Key | Description |
---|---|
key | Key to identify in redis |
fieldname | Field name specified in the form |
name | Name of the file on the user's computer |
encoding | Encoding type of the file |
mimetype | Mime type of the file |
4.10.0
11 months ago
4.9.3
2 years ago
4.9.0
2 years ago
4.9.2
2 years ago
4.9.1
2 years ago
4.5.0
3 years ago
4.4.0
4 years ago
4.3.0
4 years ago
4.1.0
4 years ago
4.0.0
4 years ago
3.2.0
4 years ago
3.0.0
4 years ago
2.2.0
4 years ago
2.1.0
4 years ago
2.0.0
4 years ago
1.8.0
5 years ago
1.7.0
5 years ago
1.6.0
5 years ago
1.5.1
5 years ago
1.5.0
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago