
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
easy-folderator
Advanced tools
An easy way to automatically include and name modules in subdirectories.
#Easy Folderator
An easy way to automatically include and name modules in subdirectories.
##Installation
npm install easy-folderator
##Usage
Easy Folderator makes use of promises.
Lets say we have the following directory structure:
folder/
inner-folder/
deeper-inner-folder/
deeper-inner-test-module.js
inner-test-module.js
test-module.js
The folderator.createPackage function will return an object with the following structure:
var package = {
innerFolder: {
deeperInnerFolder {
deeperInnerTestModule: /* module.exports of deeper-inner-test-module.js */
},
innerTestModule: /* module.exports of inner-test-module.js */
},
testModule: /* module.exports of test-module.js */
}
##Example
This example uses the same folder structure as above under Usage. lets say we have a folder called models with the following structure:
models/
user.js
post.js
Let's also say that the exports object of each model is simply this:
module.exports = __filename;
Now lets look at what will happen:
var path = require('path');
var folderator = require('easy-folderator');
var packagePath = path.join(__dirname, 'models');
folderator
.createPackage({
rootDir: packagePath, // a required option
captializeModules: true
})
.then(function (pack) {
console.log(pack.User);
// logs:
// /path/to/file/models/user.js
});
##Options
Options are passed to the createPackage function via an object:
folderator
.createPackage({
rootDir: myPath
})
Only rootDir is required. There are no default options so you must always pass an object with rootDir set to a string in order for the it to work.
FAQs
An easy way to automatically include and name modules in subdirectories.
We found that easy-folderator 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

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.