first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
# fs.readdirSyncRecursive
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]
Read a directory recursively.
## Install
```bash
npm install fs-readdir-recursive
```
## Example
```js
var read = require('fs-readdir-recursive')
read(__dirname) === [
'test/test.js',
'index.js',
'LICENSE',
'package.json',
'README.md'
]
```
## API
### read(root [, filter])
`root` is the directory you wish to scan. `filter` is an optional filter for the files. By default, filter is:
```js
function (x) {
return x[0] !== '.'
}
```
Which basically just ignores `.` files.
[npm-image]: https://img.shields.io/npm/v/fs-readdir-recursive.svg?style=flat-square
[npm-url]: https://npmjs.org/package/fs-readdir-recursive
[github-tag]: http://img.shields.io/github/tag/fs-utils/fs-readdir-recursive.svg?style=flat-square
[github-url]: https://github.com/fs-utils/fs-readdir-recursive/tags
[travis-image]: https://img.shields.io/travis/fs-utils/fs-readdir-recursive.svg?style=flat-square
[travis-url]: https://travis-ci.org/fs-utils/fs-readdir-recursive
[coveralls-image]: https://img.shields.io/coveralls/fs-utils/fs-readdir-recursive.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/fs-utils/fs-readdir-recursive
[david-image]: http://img.shields.io/david/fs-utils/fs-readdir-recursive.svg?style=flat-square
[david-url]: https://david-dm.org/fs-utils/fs-readdir-recursive
[license-image]: http://img.shields.io/npm/l/fs-readdir-recursive.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/fs-readdir-recursive.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/fs-readdir-recursive
[gittip-image]: https://img.shields.io/gratipay/jonathanong.svg?style=flat-square
[gittip-url]: https://gratipay.com/jonathanong/
+26
View File
@@ -0,0 +1,26 @@
var fs = require('fs')
var path = require('path')
module.exports = read
function read(root, filter, files, prefix) {
prefix = prefix || ''
files = files || []
filter = filter || noDotFiles
var dir = path.join(root, prefix)
if (fs.statSync(dir).isDirectory())
fs.readdirSync(dir)
.filter(filter)
.forEach(function (name) {
read(root, filter, files, path.join(prefix, name))
})
else
files.push(prefix)
return files
}
function noDotFiles(x) {
return x[0] !== '.'
}
+61
View File
@@ -0,0 +1,61 @@
{
"_from": "fs-readdir-recursive@0.1.0",
"_id": "fs-readdir-recursive@0.1.0",
"_inBundle": false,
"_integrity": "sha1-QrIwNHUxdK5Xu4EfMsOld3OjLj8=",
"_location": "/fs-readdir-recursive",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "fs-readdir-recursive@0.1.0",
"name": "fs-readdir-recursive",
"escapedName": "fs-readdir-recursive",
"rawSpec": "0.1.0",
"saveSpec": null,
"fetchSpec": "0.1.0"
},
"_requiredBy": [
"/6to5-core"
],
"_resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-0.1.0.tgz",
"_shasum": "42b23034753174ae57bb811f32c3a57773a32e3f",
"_spec": "fs-readdir-recursive@0.1.0",
"_where": "/srv/http/mmap_sarrebourg/user/themes/basic/node_modules/6to5-core",
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com"
},
"bugs": {
"url": "https://github.com/jonathanong/fs-readdir-recursive/issues",
"email": "me@jongleberry.com"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Recursively read a directory",
"devDependencies": {
"istanbul": "0",
"mocha": "*",
"should": "*"
},
"engines": {
"node": ">= 0.10"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonathanong/fs-readdir-recursive#readme",
"license": "MIT",
"name": "fs-readdir-recursive",
"repository": {
"type": "git",
"url": "git+https://github.com/jonathanong/fs-readdir-recursive.git"
},
"scripts": {
"test": "mocha --reporter spec",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
},
"version": "0.1.0"
}