module-not-found-error

Create a module not found error

MIT 2 个版本
安装
npm install module-not-found-error
yarn add module-not-found-error
pnpm add module-not-found-error
bun add module-not-found-error
README

module-not-found-error Build Status

Create a module not found error

Install

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

Usage

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

版本列表
1.0.1 2015-07-03
1.0.0 2015-05-23