# module-lookup-amd

> Resolve aliased dependency paths using a RequireJS config

Latest version **10.0.1** (published 2026-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install module-lookup-amd
pnpm add module-lookup-amd
yarn add module-lookup-amd
bun add module-lookup-amd
```

Provides the command `lookup-amd`.

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 10.0.1 |
| Published | 2026-05-26 |
| First published | 2014-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 \|\| >=22.12.0 |
| Dependencies | 3 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Joel Kemp |
| Maintainers | pahen, mrjoelkemp, xhmikosr |
| Keywords | amd, module, lookup, alias |

## Links

- npm: https://www.npmjs.com/package/module-lookup-amd
- Repository: https://github.com/dependents/node-module-lookup-amd
- Issues: https://github.com/dependents/node-module-lookup-amd/issues
- npm.io page: https://npm.io/package/module-lookup-amd

## Dependencies (3)

- [commander](https://npm.io/package/commander.md) ^14.0.3
- [requirejs](https://npm.io/package/requirejs.md) ^2.3.8
- [requirejs-config-file](https://npm.io/package/requirejs-config-file.md) ^4.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 10.0.1 (latest) — 2026-05-26
- 10.0.0 — 2026-05-19
- 9.1.3 — 2026-04-27
- 9.1.2 — 2026-04-19
- 9.1.1 — 2026-02-23
- 9.1.0 — 2026-02-09
- 9.0.5 — 2025-06-16
- 9.0.4 — 2025-02-02
- 9.0.3 — 2025-02-01
- 9.0.2 — 2024-07-26
- 9.0.1 — 2024-04-10
- 9.0.0 — 2024-04-10
- 8.0.5 — 2023-05-13
- 8.0.4 — 2023-05-10
- 8.0.3 — 2023-05-04
- … 26 more at https://npm.io/package/module-lookup-amd/versions

## README

# module-lookup-amd

[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-module-lookup-amd/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-module-lookup-amd/actions/workflows/ci.yml?query=branch%3Amain)
[![npm version](https://img.shields.io/npm/v/module-lookup-amd?logo=npm&logoColor=fff)](https://www.npmjs.com/package/module-lookup-amd)
[![npm downloads](https://img.shields.io/npm/dm/module-lookup-amd)](https://www.npmjs.com/package/module-lookup-amd)

> Resolve AMD dependency paths to an absolute path on the filesystem

This module takes in a partial and *synchronously* gives back its absolute path on the filesystem.

I built this for [Dependents'](https://packagecontrol.io/packages/Dependents) [jump to dependency](https://github.com/dependents/Dependents) feature that lets you click on a module name
and open the relevant file.

```sh
npm install module-lookup-amd
```

## Usage

### ESM

```js
import lookup from 'module-lookup-amd';

const realPath = lookup({
  partial: 'someModule',
  filename: 'file/containing/partial',
  directory: 'path/to/all/js/files', // optional
  config: 'path/to/my/requirejs/config', // optional
  configPath: 'path/to/config/directory', // optional
  fileSystem: {} // optional
});
```

### CommonJS

```js
const { default: lookup } = require('module-lookup-amd');
```

* `partial`: the dependency that you want to lookup
* `filename`: the path of the file that contains the dependency (i.e., parent module)
* `directory`: Used to resolve files if you're not using a requirejs config
* `config`: the path to your RequireJS configuration file
  * As an optimization, you can provide a pre-parsed config object (the contents of the RequireJS config in object form)
  as `config`. You are then required to provide a `configPath` or `directory` argument which is assumed to be the location where your config would have been.
* `configPath`: path to the config file (or its directory) used to determine the module resolution directory; inferred automatically when `config` is a string path
* `fileSystem`: An alternative `fs` implementation to use for filesystem interactions. Defaults to Node.js's `fs` implementation if not supplied.

## CLI

Assumes a global `-g` installation

```sh
lookup-amd -c path/to/my/config.js -f path/to/file/containing/dependency -d path/containing/all/files my/dependency/name
```

## License

[MIT](LICENSE)

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