Library

Introduced in 3.0.0 as Helper

Renamed to Library in 4.0.0

Stability: 2 - Stable

const Library = require('kado/lib/Library')

This is searching library the helps locate other libraries in various system paths. Essentially, this is an extension of the require() system provided internally by Node.js and provides a layer of abstraction so that any underlying module loader may be used.

Example Usage:

const app = require('kado').getInstance()
const Foo = app.lib('foo')
const Bar = app.lib('bar')
const BarFile = app.lib.resolve('bar')
const Bar2 = require(BarFile)

Class: Library

static Library.getInstance()

Library.constructor()

Library.nextKey(obj)

Library.addPath(path)

Library.existsPath(path)

Library.add(name, file)

Library.exists(name)

Library.remove(name)

Library.search(name)

Throws an error if no library is found.