
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Another Server Mock for web develop using Node.js
Simple
const mocker = require('sermock');
var config = {
PORT: 3002, // PORT config, 3002 if you don't set
nocache: false, // cache config
static: ['./static'], // static file dir
apis: {
'/bang': { // path
'GET': { // Method and Response
code: 0,
msg: 'success'
},
'POST': '__REQ_QUERY__' // Response the Querystring as JSON
},
},
db_file: './sermock.1db.json', // DB File Config
};
mocker.create(config);
mocker.start();
The db_file Config, just an example
{
"detail": {
"id": 1,
"title": "bala",
"content": "Lorem ipsum dolor sit amet."
},
"list": [{
"id": 1,
"title": "bala"
},{
"id": 2,
"title": "foo"
}]
}
Then you can request these api:
BTW, If you POST to http://localhost:3002/bang?id=1&msg=cool
and you will get these response (as same as querystring).
{id: 1, msg: 'cool'}
_res=__REQ_QUERY__
as a querystring;_statusCode=XXX
, XXX is HTTP status code;EOF
FAQs
server mock for develop
We found that sermock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.