Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pushpop

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pushpop

A lightweight image cropping tool and thumbnail generator for Node.js

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

#pushpop

A lightweight image cropping tool and thumbnail generator for Node.js

##Configuration

var pushpop = require('pushpop');

pushpop.config({

// [required] set the global upload directory //
	uploads:path.join(__dirname, '..', '/uploads'),

// [optional] overwrite file names with unique ids //
	uniqueIds:true,

// [optional] enable logging //
	enableLogs:true,

// [optional] save files to gcloud instead of the local filesystem //
	service: { name:'gcloud', bucket:'pushpop'}
})

##Handling Uploads

pushpop is middleware that intercepts incoming POST requests that contain image data and generates a thumbnail from the metadata contained in the request. It then saves both the source image and thumbnail to a local or remote location of your choosing.

To use it simply add it to your POST request handler like so:

app.post('/upload', pushpop.upload, function(req, res)
{
	if (!pushpop.error){
		res.send('ok').status(200);
	}	else{
		res.send(pushpop.error).status(500);
	}
});

Source & Documentation

Keywords

FAQs

Package last updated on 08 Nov 2018

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