# grob-files

> Find files with special suffix in one or many folders

Latest version **0.0.3** (published 2017-05-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install grob-files
pnpm add grob-files
yarn add grob-files
bun add grob-files
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-05-05 |
| First published | 2017-04-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liangklfangl |
| Maintainers | liangklfangl |
| Keywords | find-files, file, path, recursive |

## Links

- npm: https://www.npmjs.com/package/grob-files
- Repository: https://github.com/liangklfangl/find-files
- Homepage: https://github.com/liangklfangl/find-files#readme
- Issues: https://github.com/liangklfangl/find-files/issues
- npm.io page: https://npm.io/package/grob-files

## Dependencies (3)

- [ramda](https://npm.io/package/ramda.md) ^0.23.0
- [winpath](https://npm.io/package/winpath.md) ^0.0.1
- [string-mangle](https://npm.io/package/string-mangle.md) 0.0.4

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-05-05
- 0.0.2 — 2017-04-25
- 0.0.1 — 2017-04-21

## README

### Install
```js
$ npm install --save find-file
```
### Usage
```js
const Grob = require('find-file');
const mdfiles = Grob.getFiles(["./filelists"],'md',true);
//Then you will get all markdown files
```
### Parameters
(1)source

The first paramter is source folder to search  file with special suffix. It can be an array or an object. When it is an object ,we will only care about value of object while key is omitted!

(2)suffix

To search file with this suffix, such as `"md" or "js/jsx"` and so on.

(3)isObject

When this one is set true, then we will get something like bellow with file structure of this:

![](./file.PNG)

```js
{ filelists:
   { hello: 'filelists/hello.md',
     index: 'filelists/index.md',
     md:
      { fol: { 
        index: 'filelists/md/fol/index.md'
         },
        index: 'filelists/md/index.md' 
     }
 }
}
```
 When this paramter is false, we will get something like that:
```js
[ 'filelists/hello.md',
  'filelists/index.md',
  'filelists/md/fol/index.md',
  'filelists/md/index.md',
]
```

### API

(1)getFiles

Get files with special suffix

(2)traverse

Get filename with path prefixed , it is a inverse operation of getFiles.
```js
Grob.traverse(files,function(filename){
  if(!filename)
  console.log(filename);
 //  filelists/hello.md
  // filelists/index.md
  // filelists/md/fol/index.md
  // filelists/md/index.md
})
```

(3)getRequiredFile(source,suffix)

Source and suffix as described above. Invoke this method you will get something like bellow:
```js
 {
  'filelists': {
    'hello': require('C:/Users/Administrator/Desktop/find-files/filelists/hello.md'),
    'index': require('C:/Users/Administrator/Desktop/find-files/filelists/index.md'),
    'md': {
      'fol': {
        'index': require('C:/Users/Administrator/Desktop/find-files/filelists/md/fol/index.md')
      },
      'index': require('C:/Users/Administrator/Desktop/find-files/filelists/md/index.md')
    }
  }
}
```

---
_Source: https://npm.io/package/grob-files · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
