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.
Autoload your scripts! the successor to express-load
Consign makes applications easier to develop with logical file separation and automatic script loading.
Consign can be used to autoload models, routes, schemas, configs, controllers, object maps... etc...
var consign = require('consign');
consign()
.include('models')
.then('controllers')
.into(app);
// app.models.user
// app.models.company
// app.controllers.user
// app.controllers.company
Check out the examples or test folder for more!
$ npm install consign
The optional options object is passed in as a parameter to the main consign
function.
consign({
cwd: process.cwd(),
locale: 'en-us',
logger: console,
verbose: true,
extensions: [ '.js', '.json', '.node' ],
loggingType: 'info'
})
logger
- Defaults to console, this can be switched out.
verbose
- On by default, set to false
for no logging
loggingType
- Set the type of logging, defaults to info
Current supported locale (for logging output):
Consign will simply use a relative path from your current working directory, however sometimes you don't want heavily nested files included in the object chain, so you can set the cwd:
consign()
.include('app') // ./app/controllers/user.js
.into(app);
would result in:
app.app.controllers.user
so using the cwd
option:
consign({cwd: 'app'})
.include('app') // ./app/controllers/user.js
.into(app);
would give us:
app.controllers.user
Defaults to an array containing .js
, .json
and .node
, new ones are concatenated instead of replaced.
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
FAQs
Autoload your scripts.
The npm package consign receives a total of 3,419 weekly downloads. As such, consign popularity was classified as popular.
We found that consign 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.