Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
consign
Advanced tools
Readme
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...
Also if you are writing scripts and just need to add some structure, check out (middleware-chain)[https://github.com/jarradseers/middleware-chain], there is a new example for this usage in the examples folder.
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 1,676 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.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.