Gathering detailed insights and metrics for webpack-dev-mock
Gathering detailed insights and metrics for webpack-dev-mock
Gathering detailed insights and metrics for webpack-dev-mock
Gathering detailed insights and metrics for webpack-dev-mock
npm install webpack-dev-mock
Typescript
Module System
Node Version
NPM Version
TypeScript (90.91%)
JavaScript (6.38%)
CSS (1.59%)
EJS (0.93%)
AppleScript (0.18%)
Shell (0.01%)
Total Downloads
183,840
Last Day
7
Last Week
93
Last Month
809
Last Year
18,208
18,344 Stars
3,237 Commits
2,113 Forks
440 Watching
64 Branches
123 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
webpack-dev-mock@2.0.0
Unpacked Size
15.11 kB
Size
5.29 kB
File Count
11
NPM Version
6.14.15
Node Version
12.22.7
Publised On
09 Dec 2021
Cumulative downloads
Total Downloads
Last day
-77.4%
7
Compared to previous day
Last week
-65.9%
93
Compared to previous week
Last month
-29.5%
809
Compared to previous month
Last year
-48.5%
18,208
Compared to previous year
mock-dev-server 是一个 express 服务的中间件
读取项目目录下的 mock/index.js
文件生成,会配置对应的接口。
1// mock/index.js 2const foo = require('./foo.json'); 3const bar = require('./bar'); 4 5module.exports = { 6 // 同时支持 GET 和 POST 7 '/api/users/1': foo, 8 '/api/foo/bar': bar(), 9 10 // 支持标准 HTTP 11 'GET /api/users': { users: [1, 2] }, 12 'DELETE /api/users': { users: [1, 2] }, 13 14 // 支持自定义函数,API 参考 express4 15 'POST /api/users/create': (req, res) => { 16 res.end('OK'); 17 }, 18 19 // 支持参数 20 'POST /api/users/:id': (req, res) => { 21 const { id } = req.params; 22 res.send({ id: id }); 23 }, 24};
1// server.js 2const express = require('express'); 3 4const mockServer = require('mock-server'); 5 6const app = express(); 7 8mockServer(app); 9 10app.get('/', (req, res) => res.send('hello world')); 11 12app.listen(6001, () => { 13 console.log('Example app listening on port 6001!'); 14 console.log('http://127.0.0.1:6001'); 15});
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
11 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 20/25 approved changesets -- score normalized to 8
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
44 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
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 Moremocker-api
This is dev support mock RESTful API.
express-proxy-mock
This is an express middleware that can be used with webpack and vite. Its main function is to visualize the configuration, manage proxies, and mock data.
webpack-api-mocker
This is dev support mock RESTful API.
webpack-mock-server
Mocks api requests for webpack-dev-server with hot-replacement