
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
Scans a given directory and get back a tree with the results of the path and its sub-paths.
Scans a given directory and get back a tree with the results of the path and its sub-paths.
This module aims to give you an object with a tree to get any directory found using the "dot" notation, an array collection of the sub-paths and some other options to help you more.
npm install --save fs-scanner or yarn add fs-scanner
Whenever you import it, it will give you a class to create instances.
const Scanner = require('fs-scanner')
After having it imported you will need to pass some options to scan:
| name | type | default | description |
|---|---|---|---|
| path | string | __dirname | Absolute path of the directory to scan. |
| index | string | '_' | A name used in the tree to access to the root of each directory. |
| prefix | object | null | This lets you to prepend a text to alter the name of each directory. |
| suffix | object | null | This lets you to append a text to alter the name of each directory. |
| ignore | string/array | null | You can ignore a path using piece of string or an array with the name of the directories. |
const { resolve } = require('path')
const root = src => resolve(process.cwd(), src)
const scanner = new Scanner()
console.log(scanner)
/*
Scanner {
_path: '/Users/Owner/Projects/ScanDirectories',
_ignore: null,
_index: '_',
_prefix: null,
_suffix: null,
_cwd: 'ScanDirectories',
_directory: null,
_isIgnored: false,
_tree:
{ cwd:
{ _: '/Users/Owner/Projects/ScanDirectories',
dist: [Object],
src: [Object] } },
_collection:
[ '/Users/Owner/Projects/ScanDirectories',
'/Users/Owner/Projects/ScanDirectories/dist',
'/Users/Owner/Projects/ScanDirectories/src',
'/Users/Owner/Projects/ScanDirectories/src/client',
'/Users/Owner/Projects/ScanDirectories/src/client/assets',
'/Users/Owner/Projects/ScanDirectories/src/client/assets/css',
'/Users/Owner/Projects/ScanDirectories/src/client/assets/css/vendor',
'/Users/Owner/Projects/ScanDirectories/src/client/assets/fonts',
'/Users/Owner/Projects/ScanDirectories/src/client/assets/img',
'/Users/Owner/Projects/ScanDirectories/src/client/assets/js',
'/Users/Owner/Projects/ScanDirectories/src/client/assets/js/vendor',
'/Users/Owner/Projects/ScanDirectories/src/client/components',
'/Users/Owner/Projects/ScanDirectories/src/client/components/about',
'/Users/Owner/Projects/ScanDirectories/src/server',
'/Users/Owner/Projects/ScanDirectories/src/server/router',
'/Users/Owner/Projects/ScanDirectories/src/shared' ] }
*/
const { resolve } = require('path')
const root = src => resolve(process.cwd(), src)
const scanner = new Scanner({
path: root('./src')
})
console.log(scanner.tree)
console.log(scanner.collection)
/*
{ src:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
client:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client',
assets: [Object],
components: [Object] },
server:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/server',
router: [Object] },
shared:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' } } }
[ '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets/css',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets/css/vendor',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets/fonts',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets/img',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets/js',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/assets/js/vendor',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/components',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/components/about',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/server',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/server/router',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' ]
*/
const { resolve } = require('path')
const root = src => resolve(process.cwd(), src)
const scanner = new Scanner({
path: root('./src'),
ignore: '/assets',
})
console.log(scanner.tree)
console.log(scanner.collection)
/*
{ src:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
client:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client',
components: [Object] },
server:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/server',
router: [Object] },
shared:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' } } }
[ '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/components',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/components/about',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/server',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/server/router',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' ]
*/
const { resolve } = require('path')
const root = src => resolve(process.cwd(), src)
const scanner = new Scanner({
path: root('./src'),
ignore: ['/assets', 'server'],
})
console.log(scanner.tree)
console.log(scanner.collection)
/*
{ src:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
client:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client',
components: [Object] },
shared:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' } } }
[ '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/components',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/client/components/about',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' ]
*/
const { resolve } = require('path')
const root = src => resolve(process.cwd(), src)
const scanner = new Scanner({
path: root('./src'),
ignore: ['/assets', 'server'],
prefix: {
client: 'prefijo',
},
suffix: {
client: 'sufijo',
},
})
console.log(scanner.tree)
console.log(scanner.collection)
/*
{ src:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
client:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo',
components: [Object] },
shared:
{ _: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' } } }
[ '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo/components',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo/components/about',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' ]
*/
const { resolve } = require('path')
const root = src => resolve(process.cwd(), src)
const scanner = new Scanner({
path: root('./src'),
ignore: ['/assets', 'server'],
prefix: {
client: 'prefijo',
},
suffix: {
client: 'sufijo',
},
index: '__root__',
})
console.log(scanner.tree)
console.log(scanner.collection)
/*
{ src:
{ __root__: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
client:
{ __root__: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo',
components: [Object] },
shared:
{ __root__: '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' } } }
[ '/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo/components',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/prefijo/client/sufijo/components/about',
'/Users/norman/Projects/2017/jul/github/personal/ScanDirectories/src/shared' ]
*/
FAQs
Scans a given directory and get back a tree with the results of the path and its sub-paths.
We found that fs-scanner 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
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.