
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@airquality/mock-server
Advanced tools
Node mock server based on Koa.
npm install @airquality/mock-server
All .js
files in cwd(current work directory) will be watched and treated as routes configuration files. Every .js
file must be exported an array property routes
. Every route object in routes
must exist three properties: path
, method
and handler
. The handler
function will be injected a request data object. See following:
// HelloWorld.js
module.exports = {
routes: [
{
path: '/',
method: 'get',
handler: ({ headers, params, query, body, cookies, ctx }) => {
// You can get request data by above params.
// Returns will be sent to client.
return 'Hello World!'
},
},
],
}
In your package.json
file, add a script to start mock server by use mock-server
command.
// package.json
...
script: {
"mock": "mock-server",
...
}
...
Finally, type npm run mock
in your work directory.
npm run mock
Set mockServerOptions
in package.json
file to change default options.
// package.json
...
"mockServerOptions": {
// Default path is cwd(current work directory)
"path": "./routes",
// Default server port is 4000
"port": 4001
}
...
You can use faker.js to generate data.
MIT.
FAQs
Node mock server based on Koa
We found that @airquality/mock-server 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.