optional

WebJar for optional

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

optional
Last Version

Last Version

0.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

optional
WebJar for optional
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/tony-o/node-optional

Download optional

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/optional/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>optional</artifactId>
    <version>0.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/optional/
implementation 'org.webjars.npm:optional:0.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/optional/
implementation ("org.webjars.npm:optional:0.1.3")
'org.webjars.npm:optional:jar:0.1.3'
<dependency org="org.webjars.npm" name="optional" rev="0.1.3">
  <artifact name="optional" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='optional', version='0.1.3')
)
libraryDependencies += "org.webjars.npm" % "optional" % "0.1.3"
[org.webjars.npm/optional "0.1.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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

Requirements

Nodejs v4.0.0 or later

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

Versions

Version
0.1.3