npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ee-formdata-reader

v0.1.19

Published

reads formdata from requests

Downloads

3

Readme

ee-formdata-reader

simple but powerful formdata parser. parses mutipart & urlencoded data from request. caches files in memory or on the disk.

installation

npm install ee-formdata-reader

build status

Build Status

usage

// reader with defaults
var reader = new FormdataReader(request);

// reader with custom limits. all limits are optional
var reader = new FormdataReader({
	  request: request
	, maxLength: 1000 * 1000 * 10 		// 10mb, defaults to 128mb
	, maxFormdataLength: 10000 			// 10k for non file form fields, defaults to 2 mb
	, maxFileLength: 1000 * 1000 * 2 	// 2mb, defaults to 128mb
	, cachePath: '/tmp' 				// store files on the fs instead in memory, defaults to memory
	, cacheId: 'some machine id' 		// if files are stored on the filesystem they will contain a 
										// machine identifier in their filename so one can use shared
										// storage solutions between mutliple machines. defaults to 
										// an identifier provided by the «ee-machine-id» package
});

// when the request has ended and all data has been received, decoded and cached
// the reader will emit an «end» event
reader.on('end', function(){
	// you may retreive the formdata using the «getForm» method
	log(reader.getForm());
});

example

var reader = new FormdataReader(request);

reader.on('end', function(){
	log(reader.getForm());
	// name: 'Michael'
	// files: [
	//    {
	//        data: 2e 2e 2e 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 66 69 6c 65 31 2e 74 78 74 20 2e 2e 2e 
	//        , filename: "file1.txt"
	//    }
	//    , {
	//        data: 2e 2e 2e 63 6f 6e 74 65 6e 74 73 20 6f 66 20 66 69 6c 65 32 2e 67 69 66 2e 2e 2e 
	//        , filename: "file2.gif"
	//    }
	// ]
});