Socket
Socket
Sign inDemoInstall

lipo-koa

Package Overview
Dependencies
84
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lipo-koa

Lipo middleware for Lad and Koa


Version published
Weekly downloads
14
increased by1300%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

lipo-koa

build status code coverage code style styled with prettier made with lass license

Lipo middleware for Lad and Koa

Table of Contents

Install

npm:

npm install lipo-koa

yarn:

yarn add lipo-koa

Usage

const Koa = require('koa');
const multer = require('koa-multer');
const bytes = require('bytes');
const errorHandler = require('koa-better-error-handler');
const lipoKoa = require('lipo-koa');

const app = new Koa();

const upload = multer({
  limits: {
    fieldNameSize: bytes('100b'),
    fieldSize: bytes('1mb'),
    fileSize: bytes('5mb'),
    fields: 10,
    files: 1
  }
});
app.use(upload.single('input'));

// override koa's undocumented error handler
app.context.onerror = errorHandler;

// specify that this is our api
app.context.api = true;

// use lipo's koa middleware
app.use(lipoKoa);

// start server
app.listen(3000);

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh

Keywords

FAQs

Last updated on 10 Dec 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc