{"id":15853170,"url":"https://github.com/fabioricali/readdirsync2","last_synced_at":"2025-04-01T18:42:28.539Z","repository":{"id":57348661,"uuid":"103516140","full_name":"fabioricali/readdirSync2","owner":"fabioricali","description":"readdirSync with some useful options: recursively, exclude name and ext, get only file or directory.","archived":false,"fork":false,"pushed_at":"2017-09-14T10:04:57.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T14:38:07.657Z","etag":null,"topics":["javascript","node-js","readdir","readdirsync","recursive"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabioricali.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-09-14T09:52:24.000Z","updated_at":"2018-09-12T08:11:35.000Z","dependencies_parsed_at":"2022-09-02T13:30:11.939Z","dependency_job_id":null,"html_url":"https://github.com/fabioricali/readdirSync2","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2FreaddirSync2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2FreaddirSync2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2FreaddirSync2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2FreaddirSync2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabioricali","download_url":"https://codeload.github.com/fabioricali/readdirSync2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246693084,"owners_count":20818802,"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":["javascript","node-js","readdir","readdirsync","recursive"],"created_at":"2024-10-05T19:03:08.628Z","updated_at":"2025-04-01T18:42:28.514Z","avatar_url":"https://github.com/fabioricali.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003ereaddirsync2\u003c/h1\u003e\nreaddirSync with some useful options: recursively, exclude name and ext, get only file or directory.\n\u003cbr/\u003e\u003cbr/\u003e\n\u003ca href=\"https://travis-ci.org/fabioricali/readdirSync2\" target=\"_blank\"\u003e\u003cimg src=\"https://travis-ci.org/fabioricali/readdirSync2.svg?branch=master\" title=\"Build Status\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/fabioricali/readdirSync2?branch=master\" target=\"_blank\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/fabioricali/readdirSync2/badge.svg?branch=master\" title=\"Coverage Status\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" title=\"License: MIT\"/\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/team-terrons-orange.svg\" title=\"Team Terrons\"/\u003e\n\u003c/div\u003e\n\n## Installation\n\n```\nnpm install readdirsync2 --save\n```\n\n# Example\n\n#### Basic usage\n\n```javascript\nconst readdirSync = require('readdirsync2');\nreaddirSync('./foo/bar');\n```\n\n#### Get only files\n\n```javascript\nreaddirSync('./foo/bar', {only: 'file'});\n```\n\n#### Get only directories\n\n```javascript\nreaddirSync('./foo/bar', {only: 'directory'});\n```\n\n#### Disable recursive mode\n\n```javascript\nreaddirSync('./foo/bar', {recursive: false});\n```\n\n#### Ignore files with extension\n\n```javascript\nreaddirSync('./foo/bar', {ignoreExt: ['.js', '.txt']});\n```\n\n#### Ignore files or directories with name\n\n```javascript\nreaddirSync('./foo/bar', {ignoreName: ['index.js', 'my-folder']});\n```\n\n### API\n\u003ca name=\"readdirSync\"\u003e\u003c/a\u003e\n\n## readdirSync(dir, [opts]) ⇒ \u003ccode\u003eArray\u003c/code\u003e\nRead directory content\n\n**Kind**: global function  \n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eParam\u003c/th\u003e\u003cth\u003eType\u003c/th\u003e\u003cth\u003eDefault\u003c/th\u003e\u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n\u003ctr\u003e\n    \u003ctd\u003edir\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003cp\u003edirectory path\u003c/p\u003e\n\u003c/td\u003e\n    \u003c/tr\u003e\u003ctr\u003e\n    \u003ctd\u003e[opts]\u003c/td\u003e\u003ctd\u003e\u003ccode\u003eObject\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003cp\u003eoptions\u003c/p\u003e\n\u003c/td\u003e\n    \u003c/tr\u003e\u003ctr\u003e\n    \u003ctd\u003e[opts.ignoreExt]\u003c/td\u003e\u003ctd\u003e\u003ccode\u003eArray\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003e[]\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cp\u003ean array of extensions to ignore, eg: \u0026#39;.txt\u0026#39;\u003c/p\u003e\n\u003c/td\u003e\n    \u003c/tr\u003e\u003ctr\u003e\n    \u003ctd\u003e[opts.ignoreName]\u003c/td\u003e\u003ctd\u003e\u003ccode\u003eArray\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003e[]\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cp\u003ean array of filename or directory to ignore, eg: \u0026#39;index.js\u0026#39;\u003c/p\u003e\n\u003c/td\u003e\n    \u003c/tr\u003e\u003ctr\u003e\n    \u003ctd\u003e[opts.only]\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003ctd\u003e\u003cp\u003eget file or directory or both. The value can be: \u003ccode\u003efile\u003c/code\u003e or \u003ccode\u003edirectory\u003c/code\u003e\u003c/p\u003e\n\u003c/td\u003e\n    \u003c/tr\u003e\u003ctr\u003e\n    \u003ctd\u003e[opts.recursive]\u003c/td\u003e\u003ctd\u003e\u003ccode\u003eboolean\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cp\u003elookup also in nested directories\u003c/p\u003e\n\u003c/td\u003e\n    \u003c/tr\u003e  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Changelog\nYou can view the changelog \u003ca target=\"_blank\" href=\"https://github.com/fabioricali/readdirsync2/blob/master/CHANGELOG.md\"\u003ehere\u003c/a\u003e\n\n## License\nreaddirsync2 is open-sourced software licensed under the \u003ca target=\"_blank\" href=\"http://opensource.org/licenses/MIT\"\u003eMIT license\u003c/a\u003e\n\n## Authors\n\u003ca target=\"_blank\" href=\"http://rica.li\"\u003eFabio Ricali\u003c/a\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioricali%2Freaddirsync2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabioricali%2Freaddirsync2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioricali%2Freaddirsync2/lists"}