1.0.2 • Published 7 months ago

yion-body-parser v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
7 months ago

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)
1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

3 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago