{"id":17472807,"url":"https://github.com/shinnn/readdir-clean","last_synced_at":"2026-05-02T10:37:50.178Z","repository":{"id":57348647,"uuid":"94771906","full_name":"shinnn/readdir-clean","owner":"shinnn","description":"Like `fs.readdir`, but excludes autogenerated contents for example .DS_Store and Thumbs.db","archived":false,"fork":false,"pushed_at":"2019-04-12T14:15:57.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T08:42:12.035Z","etag":null,"topics":["filesystem","filter","javascript","list","nodejs","promise","readdir"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shinnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-19T11:58:17.000Z","updated_at":"2019-04-12T14:15:58.000Z","dependencies_parsed_at":"2022-09-01T13:30:46.912Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/readdir-clean","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Freaddir-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Freaddir-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Freaddir-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Freaddir-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/readdir-clean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991582,"owners_count":20706129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filesystem","filter","javascript","list","nodejs","promise","readdir"],"created_at":"2024-10-18T17:37:31.101Z","updated_at":"2026-05-02T10:37:45.159Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# readdir-clean\n\n[![npm version](https://img.shields.io/npm/v/readdir-clean.svg)](https://www.npmjs.com/package/readdir-clean)\n[![Build Status](https://travis-ci.com/shinnn/readdir-clean.svg?branch=master)](https://travis-ci.com/shinnn/readdir-clean)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/readdir-clean.svg)](https://coveralls.io/github/shinnn/readdir-clean?branch=master)\n\nLike [`fs.promises.readdir()`](https://nodejs.org/api/fs.html#fs_fspromises_readdir_path_options) but excludes autogenerated contents for example `.DS_Store` and `Thumbs.db`\n\n```javascript\nconst {readdir} = require('fs').promises;\nconst readdirClean = require('readdir-clean');\n\n(async () =\u003e {\n  await readdir('.');\n  /*=\u003e [\n    '.DS_Store',\n    '.AppleDouble',\n    '.LSOverride',\n    'a.txt',\n    'b.txt',\n    'Thumbs.db'\n  ] */\n\n  await readdirClean('.');\n  /*=\u003e [\n    'a.txt',\n    'b.txt'\n  ] */\n})();\n```\n\n## Installation\n\n[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).\n\n```\nnpm install readdir-clean\n```\n\n## API\n\n```javascript\nconst readdirClean = require('readdir-clean');\n```\n\n### readdirClean(*path*)\n\n*path*: `string | Buffer | Uint8Array | URL` (directory path)  \nReturn: `Promise\u003cstring[]\u003e`\n\nSimilar to [Node.js](https://nodejs.org) built-in `fs.promises.readdir()`, but different in the following points:\n\n* `encoding` option is not supported.\n* The paths are filtered with [`require('junk').not`](https://github.com/sindresorhus/junk#junknotfilename).\n\n```javascript\n(async () =\u003e {\n  const paths = await readdirClean('path/to/dir');\n\n  paths.includes('.Spotlight-V100'); //=\u003e false\n  paths.includes('.Trashes'); //=\u003e false\n  paths.includes('Desktop.ini'); //=\u003e false\n})();\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 - 2019 Shinnosuke Watanabe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Freaddir-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Freaddir-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Freaddir-clean/lists"}