This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

yion-body-parser

1.0.2 • Public • Published

YION BODY PARSER

A body parser plugin for framework Yion

Install

$ npm install --save yion-body-parser

Usage

const { createServer, createApp } = require('yion');
const bodyParser = require('yion-body-parser');

const app = createApp();
const server = createServer(app, [bodyParser]);

app.post('/file', (req, res) => {
    const file = req.body.file; // file sent with name "file"
    res.sendFile(file.filepath, file.filename, file.mimetype);
});

API reference

File metadata :

  • filename: file name
  • filepath: file temporary path
  • encoding: file encoding
  • mimetype: file MIME type
  • length: file length
  • data: file's data (buffer)

Readme

Keywords

none

Package Sidebar

Install

npm i yion-body-parser

Weekly Downloads

7

Version

1.0.2

License

MIT

Unpacked Size

8.55 kB

Total Files

9

Last publish

Collaborators

  • kevinbalicot