# file-lookup

> Resolve filename specified by a list of paths

Latest version **0.0.2** (published 2014-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install file-lookup
pnpm add file-lookup
yarn add file-lookup
bun add file-lookup
```

## 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.2 |
| Published | 2014-05-06 |
| First published | 2014-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Zongmin Lei |
| Maintainers | leizongmin |
| Keywords | file, lookup, search |

## Links

- npm: https://www.npmjs.com/package/file-lookup
- Repository: https://github.com/leizongmin/node-file-lookup
- Issues: https://github.com/leizongmin/node-file-lookup/issues
- npm.io page: https://npm.io/package/file-lookup

## Dependencies (2)

- [async](https://npm.io/package/async.md) ~0.8.0
- [debug](https://npm.io/package/debug.md) ~0.8.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-05-06
- 0.0.1 — 2014-05-05

## README

node-file-lookup
================

指定一组目录，依次搜索指定文件（相对路径），返回其绝对文件路径，支持同步和异步方法

使用方法：

```JavaScript
var FileLookup = require('file-lookup');

var lookup = new FileLookup();

// 添加一系列目录，按添加顺序搜索
loolup.add('/path/1');
loolup.add('/path/2');

// 取实际文件名
lookup.resolve('file', function (filename) {
  if (filename) {
    console.log('Path: %s', filename);
  } else {
    console.log('Cannot lookup file');
  }
});

// 同步版本
var filename = lookup.resolveSync('file');
if (filename) {
  console.log('Path: %s', filename);
} else {
  console.log('Cannot lookup file');
}
```

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