
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
directory-tree
Advanced tools
#directory-tree
Creates an javascript object representing a directory tree.
npm i -S directory-tree
##Usage
var dirTree = require('directory-tree');
var tree = dirTree('/some/path');
And you can also filter by extensions:
var dirTree = require('directory-tree');
var filteredTree = dirTree('/some/path', ['.jpg', '.png']);
This will take a directory tree:
photos
├── summer
│ └── june
│ └── windsurf.jpg
└── winter
└── january
├── ski.png
└── snowboard.jpg
And return a js object:
{
"path": "photos",
"name": "photos",
"size": 600,
"children": [
{
"path": "photos/summer",
"name": "summer",
"size": 400,
"children": [
{
"path": "photos/summer/june",
"name": "june",
"size": 400,
"children": [
{
"path": "photos/summer/june/windsurf.jpg",
"name": "windsurf.jpg",
"size": 400,
"extension": ".jpg"
}
]
}
]
},
{
"path": "photos/winter",
"name": "winter",
"size": 200,
"children": [
{
"path": "photos/winter/january",
"name": "january",
"size": 200,
"children": [
{
"path": "photos/winter/january/ski.png",
"name": "ski.png",
"size": 100,
"extension": ".png"
},
{
"path": "photos/winter/january/snowboard.jpg",
"name": "snowboard.jpg",
"size": 100,
"extension": ".jpg"
}
]
}
]
}
]
}
Device, FIFO and socket files are ignored.
Files to which the user does not have permissions are included in the directory tree, however, directories to which the user does not have permissions, along with all of its contained files, are completely ignored.
To run tests go the package root in your CLI and run,
$ npm test
Make sure you have the dev dependcies installed (e.g. npm install .
)
Check out version 0.1.1
if you need support for older versions of node.
FAQs
Convert a directory tree to a JS object.
The npm package directory-tree receives a total of 121,007 weekly downloads. As such, directory-tree popularity was classified as popular.
We found that directory-tree 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
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.