
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
node-os-walk
Advanced tools
Python's os.walk() implementation for Node.js environments with support for the `for await...of` loops.
Python's os.walk() implementation for Node.js environments with support for the for await...of
loops.
It is recommended to use ECMA 2018 target or newer with the
node-os-walk
lib.for await...of
loops are not supported in older versions.
Generate the file names in a directory tree by walking the tree top-down. For each directory in the tree rooted at directory top (including top itself), it yields a 3-tuple: [dirpath: string, directories: Array<fs.Dirent>, files: Array<fs.Dirent>]
dirpath
- is a string, the path to the directory.directories
- is a list of Dirent
objects (from the standard fs Node library) pointing to all of directories found in the dirpath
files
- is a list of Dirent
objects (from the standard fs Node library) pointing to all of files but not directories found in the dirpath
import { walk } from "node-os-walk";
import path from "path";
async function main() {
const rootPath = path.resolve(__dirname, "./<your-path>");
for await (const [root, dirs, files] of walk(rootPath)) {
for (const directory of dirs) {
console.log("Directory:", path.resolve(root, directory.name));
}
for (const file of files) {
console.log("File:", path.resolve(root, file.name));
}
}
}
followSymlinks - by default walk()
will not list the contents of directories pointed to with symlinks, set this to true to change this behavior.
walk(rootPath, { followSymlinks: true })
ignoreErrors - walk uses the fs.readdir()
internally, if this option is set to true any errors thrown by fs.readdir()
will be suppressed and an empty list of dirs and files will be returned.
walk(rootPath, { ignoreErrors: true })
FAQs
Python's os.walk() implementation for Node.js environments with support for the `for await...of` loops.
The npm package node-os-walk receives a total of 0 weekly downloads. As such, node-os-walk popularity was classified as not popular.
We found that node-os-walk 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
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.