Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
component-as-module
Advanced tools
It allows you to require components from node programs.
Lookup algorithm is slightly different
from component/builder.js
in that it does not respect .paths
field from component.json
.
Require stand-alone component (with all dependencies in a ./components
dir):
var component = require('component-as-module')
var min = component('/path-to/component-min')
Setup loader:
var boot = component('boot', function(loader) {
// add lookup paths
loader.addLookup('./components')
// enable dev dependencies
loader.development()
// register node module as a component
loader.register('foo', require)
})
Alternative way to require components is to create a special "require" function:
var req = component.createRequire(function(loader) {
loader.addLookup('components')
})
var min = req('component-min')
This differs in that all loaded components are preserved
between calls, so, for example, requiring component-min
the second time is fast and
you get the same instance.
with npm
npm install component-as-module
To run tests
npm install -d
npm test
There is also component-npm-post-install script which can be used to make component package compatible with npm.
MIT
FAQs
Require components from node programs
The npm package component-as-module receives a total of 7 weekly downloads. As such, component-as-module popularity was classified as not popular.
We found that component-as-module 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.