
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
connect-mockery
Advanced tools

Connect middleware for simple resource mocking in single page apps
Install the module with: npm install connect-mockery
Connect-Mockery lets you put some variance in your mock data.
This module exports a single function which takes a config object and returns a
function to used as connect/express middleware.
The middleware looks at incoming requests, sees if they match a folder in your
mocks mockBase and if so the server will respond with one of the files it sees
there. Which file? Connect Mockery will cycle through them so subsequent
requests can get different responses.
Suppose I have this folder structure in my app root:
/mock
/users
user-001.json
user-002.json
user-003.json
The first request to /mock/users will get user-001.json, the next request
gets user-002.json and so on. Connect Mockery will reset the cycling process
on page reloads (in particular on requests to '/').
Use the appBase option to set you app base directory (defaults to
process.cwd() + '/app')
Use the mockBase option to set your mocks base directory (defaults to
/mock').
Use the cleanCacheOnRefresh option to enable/disable cycle resetting (defaults
to true).
var mockery = require('connect-mockery');
var opts = {
appBase: __dirname + '/app',
mockBase: '/mock',
cleanCacheOnRefresh: true
};
var app = connect()
.use(mockery(opts))
// ...
.use(function(req, res) {
res.end('hello world\n');
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2014 iVantage Health Analytics, Inc. Licensed under the MIT license.
FAQs
Connect middleware for simple resource mocking in single page apps
The npm package connect-mockery receives a total of 4 weekly downloads. As such, connect-mockery popularity was classified as not popular.
We found that connect-mockery 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.