Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
list-contents
Advanced tools
Returns a list of paths to the subfolders and subfiles of the specified location.
list-contents
is a module that returns a list of paths to the subfolders and subfiles of the specified location.
structure-dirs
package that creates the folders and files contents according to the given [Array] structure.npm install list-contents
const list = require('list-contents');
list(path,callback)
path
[String]callback
[Function]callback
function. It has 4 properties:
error
[Boolean|Error]
null
if the path
is valid, otherwise [Error] objectdirs
[Array]
The list of all subfolders' paths of the specified path
argumentfiles
[Array]
The list of all subfiles' paths of the specified path
argumentpath
[String]
The path that was given as path
parameterconst list = require('list-contents');
list("./dist",(o)=>{
if(o.error) throw o.error;
console.log('Folders: ', o.dirs);
console.log('Files: ', o.files);
});
Assuming that "./dist" path contains the following subfolders and subfiles:
dist
├ scripts
│ ├ index.js
│ └ ajax.js
├ styles
│ ├ css
│ │ ├ layout.css
│ │ └ media.css
│ └ scss
│ └ mixins.scss
└ templates
├ main.html
├ menubar.html
├ login.html
└ contact.html
the module will pass the following object through the callback
function:
{
error: false,
path: "./dist",
dirs: [
'scripts',
'templates',
'styles',
'styles/css',
'styles/scss'
],
files: [
'scripts/ajax.js',
'scripts/index.js',
'templates/contact.html',
'templates/login.html',
'templates/main.html',
'templates/menubar.html',
'styles/css/layout.css',
'styles/css/media.css',
'styles/scss/mixins.scss'
]
}
FAQs
Returns a list of paths to the subfolders and subfiles of the specified location.
The npm package list-contents receives a total of 258 weekly downloads. As such, list-contents popularity was classified as not popular.
We found that list-contents 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.