protected-require

Require modules with invalid syntax without crashing

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
protected-require
001.0.08 years ago8 years agoMinified + gzip package size for protected-require in KB

Readme

protectedRequire(moduleName , verbose)
Require without application crashing on invalid module syntax

Installation

npm install --save-dev protected-require

Usage

const protectedRequire = require('protected-require');

const someModule = protectedRequire('some-module');

verbose

pass verbose param to get error details.
const someModule = protectedRequire('some-module', true);