Installations
npm install express-formidable-v2
Developer
Abderrahman-byte
Developer Guide
Module System
CommonJS
Min. Node Version
>= 13
Typescript Support
No
Node Version
16.5.0
NPM Version
7.19.1
Statistics
2 Stars
61 Commits
1 Watching
2 Branches
1 Contributors
Updated on 26 May 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
16,729
Last day
15.4%
15
Compared to previous day
Last week
14.8%
132
Compared to previous week
Last month
6.6%
515
Compared to previous month
Last year
-37.9%
4,797
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
express-formidable-v2
This is Folk of express-formidable An Express middleware of Formidable that just works.
What are Express, Formidable, and this?
Express is a fast, unopinionated, minimalist web framework for Node.js.
Formidable is a Node.js module
for parsing form data, including multipart/form-data
file upload.
So, express-formidable
is something like a bridge between them,
specifically an Express middleware implementation of Formidable.
It aims to just work.
Install
npm install express-formidable-v2
How to use
1const express = require('express'); 2const formidableMiddleware = require('express-formidablei-v2'); 3 4var app = express(); 5 6app.use(formidableMiddleware()); 7 8app.post('/upload', (req, res) => { 9 req.fields; // contains non-file fields 10 req.files; // contains files 11});
And that's it.
express-formidable can basically parse form types Formidable can handle,
including application/x-www-form-urlencoded
, application/json
, and
multipart/form-data
.
Option
1app.use(formidableMiddleware(opts));
opts
are options which can be set to form
in Formidable. For example:
1app.use(formidableMiddleware({
2 encoding: 'utf-8',
3 uploadDir: '/my/dir',
4 multiples: true, // req.files to be arrays of files
5});
For the detail, please refer to the Formidable API.
Events
1app.use(formidableMiddleware(opts, events));
events
is an array of json with two field:
Field | Description |
---|---|
event | The event emitted by the form of formidable. A complete list of all the possible events, please refer to the Formidable Events |
action | The callback to execute. The signature is function (req, res, next, ...formidable_parameters) |
For example:
1const events = [ 2 { 3 event: 'fileBegin', 4 action: function (req, res, next, name, file) { /* your callback */ } 5 }, 6 { 7 event: 'field', 8 action: function (req, res, next, name, value) { /* your callback */ } 9 } 10];
Error event
Unless an error
event are provided by the events
array parameter, it will handle by the standard next(error)
.
Contribute
git clone https://github.com/Abderrahman-byte/express-formidable-v2
cd express-formidable
npm install
To lint and test:
npm test
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
25 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
1.7
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More