Skip to content

bendrucker/module-not-found-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Create a module not found error

Resources

License

Stars

Watchers

Forks

Packages

No packages published