# @zhangfuxing/readdir

> Get the absolute path of files in a folder

Latest version **1.0.1** (published 2020-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zhangfuxing/readdir
pnpm add @zhangfuxing/readdir
yarn add @zhangfuxing/readdir
bun add @zhangfuxing/readdir
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-01-04 |
| First published | 2020-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zhang Fu Xing |
| Maintainers | fuxingzhang |
| Keywords | node, nodejs, readdir, getFilePaths, getFolderFilePaths |

## Links

- npm: https://www.npmjs.com/package/@zhangfuxing/readdir
- Repository: https://github.com/fuxingZhang/readdir
- Homepage: https://github.com/fuxingZhang/readdir#readme
- Issues: https://github.com/fuxingZhang/readdir/issues
- npm.io page: https://npm.io/package/@zhangfuxing/readdir

## 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

- 1.0.1 (latest) — 2020-01-04
- 1.0.0 — 2020-01-04

## README

# readdir
Get the absolute path of files in a folder

## Install

```sh
$ npm i @zhangfuxing/readdir
```  

## Useage  

### use synchronous method

```js
const assert = require('assert');
const path = require('path');
const { getFilePathsSync } = require('@zhangfuxing/readdir');
const paths = getFilePathsSync('./test');
const testFilePath = path.resolve('./test/index.test.js');
assert(paths);
assert(Array.isArray(paths));
assert(paths.length === 1);
assert(paths[0] === testFilePath);
```  

### use asynchronous method
```js
const assert = require('assert');
const path = require('path');
const { getFilePaths } = require('@zhangfuxing/readdir');
const testFilePath = path.resolve('./test/index.test.js');

;(async () => {
  const paths = await getFilePaths('./test');
  assert(paths);
  assert(Array.isArray(paths));
  assert(paths.length === 1);
  assert(paths[0] === testFilePath);
})().catch(console.error);
```  

## Test

```sh
$ npm test
```

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