JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q64409F
  • License ISC

Like `fs.readdir`, but excludes autogenerated contents for example .DS_Store and Thumbs.db

Package Exports

  • readdir-clean

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (readdir-clean) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

readdir-clean

npm version Build Status Coverage Status

Like fs.promises.readdir() but excludes autogenerated contents for example .DS_Store and Thumbs.db

const {readdir} = require('fs').promises;
const readdirClean = require('readdir-clean');

(async () => {
  await readdir('.');
  /*=> [
    '.DS_Store',
    '.AppleDouble',
    '.LSOverride',
    'a.txt',
    'b.txt',
    'Thumbs.db'
  ] */

  await readdirClean('.');
  /*=> [
    'a.txt',
    'b.txt'
  ] */
})();

Installation

Use npm.

npm install readdir-clean

API

const readdirClean = require('readdir-clean');

readdirClean(path)

path: string Buffer Uint8Array URL (directory path)
Return: Promise<Array<string>>

Similar to Node.js built-in fs.promises.readdir(), but different in the following points:

(async () => {
  const paths = await readdirClean('path/to/dir');

  paths.includes('.Spotlight-V100'); //=> false
  paths.includes('.Trashes'); //=> false
  paths.includes('Desktop.ini'); //=> false
})();

License

ISC License © 2017 - 2019 Shinnosuke Watanabe