
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
npm-registry-mock
Advanced tools
#npm-registry-mock
##Usage
Currently mocked packages are:
underscore
at 1.3.1, 1.3.3 and 1.5.1 while version 1.5.1 is the latest in this mocked registry.
request
at 0.9.0, 0.9.5 and 2.27.0 while version 2.27.0 is the latest in this mocked registry.
test-package-with-one-dep
at 0.0.0, version 0.0.0 is the latest in this mocked registry. It has a mocked dependency: test-package@0.0.0
Installing underscore 1.3.1:
var mr = require("npm-registry-mock")
mr(1331, function (s) {
npm.load({registry: "http://localhost:1331"}, function () {
npm.commands.install("/tmp", "underscore@1.3.1", function (err) {
// assert npm behaves right...
s.close() // shutdown server
})
})
})
Defining custom mock routes:
var mr = require("npm-registry-mock")
var customMocks = {
"get": {
"/mypackage": [500, {"ente" : true}]
}
}
mr({port: 1331, mocks: customMocks}, function (s) {
npm.load({registry: "http://localhost:1331"}, function () {
npm.commands.install("/tmp", "mypackage", function (err) {
// assert npm behaves right with an 500 error as response...
s.close() // shutdown server
})
})
})
##Todo
FAQs
mock the npm registry
We found that npm-registry-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.