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.
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.
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.
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.