# require-paths-in-cwd

> Like `require.resolve.paths()`, but only retrieves paths inside the current working directory

Latest version **0.0.1** (published 2018-01-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install require-paths-in-cwd
pnpm add require-paths-in-cwd
yarn add require-paths-in-cwd
bun add require-paths-in-cwd
```

## 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.1 |
| Published | 2018-01-22 |
| First published | 2018-01-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | require, path, paths, cwd, working-directory, resolution, filtered |

## Links

- npm: https://www.npmjs.com/package/require-paths-in-cwd
- Repository: https://github.com/shinnn/require-paths-in-cwd
- Homepage: https://github.com/shinnn/require-paths-in-cwd#readme
- Issues: https://github.com/shinnn/require-paths-in-cwd/issues
- npm.io page: https://npm.io/package/require-paths-in-cwd

## Dependencies (1)

- [path-is-inside](https://npm.io/package/path-is-inside.md) ^1.0.2

## 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.1 (latest) — 2018-01-22
- 0.0.0 — 2018-01-22

## README

# require-paths-in-cwd

[![npm version](https://img.shields.io/npm/v/require-paths-in-cwd.svg)](https://www.npmjs.com/package/require-paths-in-cwd)
[![Build Status](https://travis-ci.org/shinnn/require-paths-in-cwd.svg?branch=master)](https://travis-ci.org/shinnn/require-paths-in-cwd)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/require-paths-in-cwd.svg)](https://coveralls.io/github/shinnn/require-paths-in-cwd?branch=master)

Like [`require.resolve.paths()`](https://nodejs.org/api/modules.html#modules_require_resolve_paths_request), but only retrieves paths inside the current working directory

```javascript

```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install require-paths-in-cwd
```

## API

```javascript
const readdirClean = require('require-paths-in-cwd');
```

### readdirClean(*path*)

*path*: `string` [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer) [`URL`](https://nodejs.org/api/url.html#url_class_url) (directory path)  
Return: `Promise<Array<string>>`

Similar to [Node.js](https://nodejs.org) built-in `fs.readdir`, but different in the following points:

* Returns a [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
* Doesn't support `encoding` option
* The paths are filtered with [`require('junk').not`](https://github.com/sindresorhus/junk#junknotfilename)

```javascript
readdirClean('path/to/dir').then(paths => {
  paths.includes('.Spotlight-V100'); //=> false
  paths.includes('.Trashes'); //=> false
  paths.includes('Desktop.ini'); //=> false
});
```

## License

[ISC License](./LICENSE) © 2017 Shinnosuke Watanabe

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