Skip to content

mcklayin/express-response-and-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-response-and-pipe

StyleCI

Helper that can pipe passed file and execute callback after file piped.

Install

npm install express-response-and-pipe

Where to use

When you need to download file and remove him after downloading.

Express Usage

const express = require('express);
const expressPipe = require('express-response-and-pipe');
app = express();

app.use(function(req, res, next) {
    const options = {
      filePath: '/path/to/file'
      callback: 'some callback function' // default is delete file callback
    };
    // File will be downloaded and callback will be fired
    expressPipe(res, options);
});

About

ExpressJs download file and execute callback after it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published