
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@bartozzz/scan-dir
Advanced tools
Searches for files in a directory and executes a callback for each. All insecure symlinks, dotfiles and files without extension are ignored.
scan-dir searches for files in a directory and executes a callback for each. All symlinks, dotfiles and files without extension are ignored. Supports deep-loading. It can be used as an autoloader for JavaScript.
$ npm install @bartozzz/scan-dir
import scan, { scanRecursively } from "scan-dir";
scan(directory, callback);
scanRecursively(directory, callback);
import path from "path";
import scan, from "scan-dir";
const models = path.resolve(__dirname, "./path/to/models");
const routes = path.resolve(__dirname, "./path/to/routes");
scan(models, (fpath, fname) => {
console.log(`Found file: ${fname} (absolute path: ${fpath})`);
});
// You can initialize modules from a directory easily:
scan(models, (fpath) => require(fpath)(some, variables, ...here));
scan(routes, (fpath) => require(fpath)(some, variables, ...here));
import path from "path";
import scan, { scanRecursively } from "scan-dir";
const modules = path.resolve(__dirname, "../node_modules");
// Those two calls are equivalents:
scan(modules, (fpath, fname) => /* … */, true);
scanRecursively(modules, (fpath, fname) => /* … */);
$ npm test
FAQs
Searches for files in a directory and executes a callback for each. All insecure symlinks, dotfiles and files without extension are ignored.
The npm package @bartozzz/scan-dir receives a total of 3 weekly downloads. As such, @bartozzz/scan-dir popularity was classified as not popular.
We found that @bartozzz/scan-dir 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.