New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@elricb/readdir-recursive

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elricb/readdir-recursive

Read directory contents recursively.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

@elricb/readdir-recursive

Built as a wrapper for node readdir function.

Recursively steps through directory and all sub-directories, returning each item into callback.

Requirements

  • node - recommended lts version >= 12

Install

$ npm install --save @elricb/readdir-recursive

Usage

Warning: This does not have any max-depth or max-file checking. If you need protection from large directories use Asynchronous, throw error inside the callback, and processing will halt.

Asynchronous

import {readdirRecursive} from "@elricb/readdir-recursive";

readdirRecursive(__dirname, function(directory, dirent) {
  if (dirent.isFile()) {
    console.log(directory);
  }
})
  .then(function() {
    console.log("Done.");
  })
  .catch(function(error) {
    console.error(error);
  });

Synchronous

import {readdirRecursiveSync} from "@elricb/readdir-recursive";

readdirRecursiveSync(__dirname, function(directory, dirent) {
  if (dirent.isDirectory()) {
    console.log(directory);
  }
});

console.log("Done.");

Documentation

Release Notes

View commit tag for release notes.

API

See ./docs/index.html.

Keywords

readdir

FAQs

Package last updated on 23 Sep 2022

Did you know?

Socket

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.

Install

Related posts