New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

argo-multiparty

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argo-multiparty

Multiparty parsing middleware for argo.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

##Multiparty Parsing for Argo

Simple middleware harnessing multiparty for parsing. The parsed multiparty result is thrown into env.multiparty.

Sample:

curl -i -X POST -H "Content-Type:multipart/form-data" -F name=test -F test=hello -F filedata=@test.txt http://localhost:3000/
//Get a file upload. Write it's original filename +'0' to the main directory of this app.
var argo = require('argo');
var argoMultiparty = require('../');
var fs = require('fs');

argo()
  .use(argoMultiparty)
  .use(function(handle) {
    handle('request', function(env, next) {

      //filedata is the data parameter of the upload.
      //Everything if after a successful parse is placed into env.multiparty for access down the pipeline.
      var file = env.multiparty.files.filedata[0];

      var rs = fs.createReadStream(file.path);
      var ws = fs.createWriteStream(file.originalFilename + '0');

      rs.pipe(ws);
      env.response.statusCode = 201;
      next(env)

    });
  })
  .listen(3000);

Keywords

FAQs

Package last updated on 01 Apr 2014

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc