optional
Allows you to optionally include modules without surrounding everything with 'try/catch'
Last updated 10 years ago by segomos .
Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install optional 
SYNC missed versions from official npm registry.

#OPTIONAL

Node-optional allows you to optionally 'require' modules without surrounding everything with 'try/catch'. Usage and installation is easy and this module itself is very easy and straightforward to use.

##Install

  npm install optional

##Usage

var optional = require("./optional");

var express = optional("express");
var fs = optional("fs");

console.log("express: " + express);
console.log("fs: " + fs);

Output:

express: null
fs: [object Object]

##Changelog ###v0.1.0-2

  • Corrected bug when trying to optionally include relative paths

Current Tags

  • 0.1.4                                ...           latest (7 years ago)

7 Versions

  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           10 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
  • 0.1.0-2                                ...           12 years ago
  • 0.1.0-1                                ...           12 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |