Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Node package for turning directory structures into plain ol' Javascript objects and vice versa.
Issues should be reported on the issue tracker.
dir2obj is intended as a complement to git for boilerplate projects.
git ignores empty directories and empty files (see here). This presents a problem when creating project boilerplates. Should you create dummy files in required directories and have the user delete these files, or have the end user learn about the required directories and create them?
dir2obj is an easy, light-weight solution for creating directory structures and empty files. See below for example uses.
npm install --save-dev dir2obj
In your boilerplate's gulpfile:
var gulp = require('gulp'),
dir2obj = require('dir2obj'),
directoryStructure = require('../dev/directory-structure.json');
gulp.task('create-dirs', function(cb) {
dir2obj(directoryStructure).then(function() {
cb();
});
});
And on the command line
git clone [your repo]
npm install
gulp create-dirs
Returns: promise
This promise resolves with an object representation of the directory. Files are empty strings and folders are directories.
Type: string
Default: .
Directory to recurse.
Type: object
Default: {}
Ignored for now. Will be fleshed out soon.
Returns: promise
This promise resolves when the directory structure has been created.
Type: object
Default: {}
The object, with objects being turned into directories and everything else being turned into files.
Type: string
Default: .
The directory into which to touch files and create directories.
Type: object
Default: {}
Ignored for now. Will be fleshed out soon with configuration settings for handling errors, etc.
Value: {}
Value: ''
MIT
FAQs
Turns directory structures into plain ol' JS objects and vice versa.
The npm package dir2obj receives a total of 0 weekly downloads. As such, dir2obj popularity was classified as not popular.
We found that dir2obj 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.