Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

scandirectory

bevry89.4kArtistic-2.08.1.1TypeScript support: included

Scan a directory recursively with a lot of control and power

deno, deno-edition, deno-entry, denoland, es2015, es2017, es2022, es5, export-default, fs, node, path, recursive, scandir, scandirectory, scanlist, scantree, tree, typed, types, typescript

readme

scandirectory

Status of the GitHub Workflow: bevry NPM version NPM downloads
GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button
Discord server badge Twitch community badge

Scan a directory recursively with a lot of control and power

Usage

Complete API Documentation.

Install

npm

Install Globally

  • Install: npm install --global scandirectory
  • Executable: scandirectory

Install Locally

  • Install: npm install --save scandirectory
  • Executable: npx scandirectory
  • Import: import pkg from ('scandirectory')
  • Require: const pkg = require('scandirectory').default

Deno

import pkg from 'https://unpkg.com/scandirectory@^8.1.1/edition-deno/index.ts'

Editions

This package is published with the following editions:

  • scandirectory aliases scandirectory/index.cjs which uses the Editions Autoloader to automatically select the correct edition for the consumer's environment
  • scandirectory/source/index.ts is TypeScript source code with Import for modules
  • scandirectory/edition-es2022/index.js is TypeScript compiled against ES2022 for Node.js 14 || 16 || 18 || 20 || 21 with Require for modules
  • scandirectory/edition-es2017/index.js is TypeScript compiled against ES2017 for Node.js 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • scandirectory/edition-es2015/index.js is TypeScript compiled against ES2015 for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • scandirectory/edition-es5/index.js is TypeScript compiled against ES5 for Node.js 4 || 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • scandirectory/edition-es2017-esm/index.js is TypeScript compiled against ES2017 for Node.js 12 || 14 || 16 || 18 || 20 || 21 with Import for modules
  • scandirectory/edition-types/index.d.ts is TypeScript compiled Types with Import for modules
  • scandirectory/edition-deno/index.ts is TypeScript source code made to be compatible with Deno

History

Discover the release history by heading on over to the HISTORY.md file.

Backers

Code

Discover how to contribute via the CONTRIBUTING.md file.

Authors

Maintainers

Contributors

Finances

GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button

Sponsors

  • Andrew Nesbitt — Software engineer and researcher
  • Balsa — We're Balsa, and we're building tools for builders.
  • Codecov — Empower developers with tools to improve code quality and testing.
  • Frontend Masters — The training platform for web app engineering skills – from front-end to full-stack! 🚀
  • Poonacha Medappa
  • Rob Morris
  • Sentry — Real-time crash reporting for your web apps, mobile apps, and games.
  • Syntax — Syntax Podcast

Donors

License

Unless stated otherwise all works are:

and licensed under:

changelog

History

v8.1.1 2024 January 3

v8.1.0 2024 January 3

v8.0.0 2024 January 1

  • Rewritten nearly everything, with the modern API at the scanDirectory export, and a compatibility layer for the old API at the default export
  • Uses an extremely performant builtin solution, that can read 7000 files in 100ms (note that outputting the relative paths to stdout takes 150ms, and outputting it all as JSON to stdout takes 2 seconds)
  • Uses promises
    • The compatibility layer supports the next callback in addition to promises
  • Returns a recursive result result map
    • The compatibility layer provides a conversion to list and tree for the next callback if it detects the old format is desired
  • Actions now accept a result object instead of individual arguments
    • The compatibility layer provides a conversion to arguments if it detects the old format is desired
  • readFile option is now encoding, as such readFile: true is now encoding: "utf8", and readFile: "binary" is now encoding: "binary"
    • The compatibility layer does not handle this conversion, you have to do it yourself
  • Upgraded to support ignorefs v5 which maintains compatibility while supporting so much more
  • Updated dependencies, base files, and editions using boundation
  • Thank you to the sponsors: Andrew Nesbitt, Balsa, Codecov, Poonacha Medappa, Rob Morris, Sentry, Syntax

v7.3.0 2023 November 25

v7.2.0 2023 November 21

v7.1.0 2023 November 15

v7.0.0 2023 November 14

  • Updated dependencies, base files, and editions using boundation
  • Minimum required Node.js version changed from node: >=10 to node: >=4 adapting to ecosystem changes

v6.18.0 2023 November 2

v6.17.0 2023 October 31

v6.16.0 2021 July 31

v6.15.0 2021 July 28

v6.14.0 2020 October 29

v6.13.0 2020 September 5

v6.12.0 2020 August 18

v6.11.0 2020 August 4

v6.10.0 2020 July 23

v6.9.0 2020 June 25

v6.8.0 2020 June 22

v6.7.0 2020 June 21

v6.6.0 2020 June 20

v6.5.0 2020 June 11

v6.4.0 2020 June 10

v6.3.0 2020 May 22

v6.2.0 2020 May 21

v6.1.0 2020 May 21

v6.0.0 2020 May 11

  • Updated dependencies, base files, and editions using boundation
  • Minimum required node version changed from node: >=8 to node: >=10 to keep up with mandatory ecosystem changes

v5.3.0 2019 December 10

v5.2.0 2019 December 1

v5.1.0 2019 December 1

v5.0.0 2019 November 18

  • Updated dependencies, base files, and editions using boundation
  • Minimum required node version changed from node: >=0.12 to node: >=8 to keep up with mandatory ecosystem changes

v4.1.0 2019 November 13

v4.0.0 2019 November 13

  • Updated dependencies, base files, and editions using boundation
  • Minimum required node version changed from node: >=0.8 to node: >=0.12 to keep up with mandatory ecosystem changes

v3.0.1 2016 October 20

  • Repackaged

v3.0.0 2016 October 20

  • Backwards compatibility breaks:
    • Action callbacks now accept different arguments than before
  • Simplified and now powered by readdir-cluster
  • Converted from CoffeeScript to JavaScript

v2.5.0 2014 December 17