# module-not-found-error

> Create a module not found error

Latest version **1.0.1** (published 2015-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install module-not-found-error
pnpm add module-not-found-error
yarn add module-not-found-error
bun add module-not-found-error
```

## 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 | 2015-07-03 |
| First published | 2015-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | module, not found, error |

## Links

- npm: https://www.npmjs.com/package/module-not-found-error
- Repository: https://github.com/bendrucker/module-not-found-error
- Issues: https://github.com/bendrucker/module-not-found-error/issues
- npm.io page: https://npm.io/package/module-not-found-error

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-07-03
- 1.0.0 — 2015-05-23

## README

# module-not-found-error [![Build Status](https://travis-ci.org/bendrucker/module-not-found-error.svg?branch=master)](https://travis-ci.org/bendrucker/module-not-found-error)

> Create a module not found error

## Install

```
$ npm install --save module-not-found-error
```

## Usage

```js
var moduleNotFoundError = require('module-not-found-error')

var err = moduleNotFoundError('foo')
//=> err.message: Cannot find module 'foo'
//=> err.code: 'MODULE_NOT_FOUND'
```

## API

#### `moduleNotFoundError(id)` -> `err`

Returns an error with the appropriate message and code.

#### `id`

*Required*  
Type: `string`

A module name or path passed to `require`.

## License

MIT © [Ben Drucker](http://bendrucker.me)

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