pax_global_header00006660000000000000000000000064125455013060014513gustar00rootroot0000000000000052 comment=a7a934aa1543f23c23be32c6c1b544573583bf5a module-not-found-error-1.0.1/000077500000000000000000000000001254550130600160355ustar00rootroot00000000000000module-not-found-error-1.0.1/.editorconfig000066400000000000000000000002741254550130600205150ustar00rootroot00000000000000root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false module-not-found-error-1.0.1/.gitattributes000066400000000000000000000000141254550130600207230ustar00rootroot00000000000000* text=auto module-not-found-error-1.0.1/.gitignore000066400000000000000000000000151254550130600200210ustar00rootroot00000000000000node_modules module-not-found-error-1.0.1/.travis.yml000066400000000000000000000000641254550130600201460ustar00rootroot00000000000000language: node_js node_js: - '0.10' - '0.12' - iojs module-not-found-error-1.0.1/index.js000066400000000000000000000002611254550130600175010ustar00rootroot00000000000000'use strict' module.exports = function createNotFoundError (path) { var err = new Error('Cannot find module \'' + path + '\'') err.code = 'MODULE_NOT_FOUND' return err } module-not-found-error-1.0.1/license000066400000000000000000000021271254550130600174040ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Ben Drucker (bendrucker.me) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. module-not-found-error-1.0.1/package.json000066400000000000000000000010441254550130600203220ustar00rootroot00000000000000{ "name": "module-not-found-error", "main": "index.js", "version": "1.0.1", "description": "Create a module not found error", "license": "MIT", "repository": "bendrucker/module-not-found-error", "author": { "name": "Ben Drucker", "email": "bvdrucker@gmail.com", "url": "bendrucker.me" }, "scripts": { "test": "standard && tape test.js" }, "keywords": [ "module", "not found", "error" ], "devDependencies": { "standard": "^4.5.2", "tape": "^4.0.0" }, "files": [ "index.js" ] } module-not-found-error-1.0.1/readme.md000066400000000000000000000013151254550130600176140ustar00rootroot00000000000000# 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) module-not-found-error-1.0.1/test.js000066400000000000000000000004271254550130600173550ustar00rootroot00000000000000'use strict' var test = require('tape') var notFound = require('./') test(function (t) { t.plan(2) try { require('foo') } catch (realErr) { var fakeErr = notFound('foo') t.equal(fakeErr.message, realErr.message) t.equal(fakeErr.code, realErr.code) } })