qtools-library-dot-d
v1.0.3
Published
Scan a directory for JS modules that can execute and addMe() that attaches it to some form of name/value list, eg, a Map() with functions as values or an xPressJS route/endpoint list.
Downloads
2
Readme
qtools-library-dot-d
NOT READY. STILL WORKING IT OUT.
NAME
qtools-library-dot-d
DESCRIPTION
Utility provides tools to scan a directory for NodeJS modules, require() them into existance with tools to connect them to a system.
First use case is adding endpoints to an expressJS system. When instantiated, qtDotD
scans a directory containing modules, dotLib.d. It requires it with two parameters,
dotD and passThroughArgs. For this case, passThrough args has two properties,
expressApp and routingPrefix. The module uses these to construct one or more
expressJS endpoitns.
the dotD object contains three parameters, add....
ASYNCHRONOUS CODE SAMPLE
const promptObjects = require('qtools-library-dot-d')({ libraryName: 'promptObjects', }, callback); promptObjects.setLibraryPath(path.join(__dirname, 'prompts.d'), callback);
const passThroughParameters = {}; promptObjects.loadModules({ passThroughParameters }, callback); promptObjects.seal(); //make the library immutable
NEW SYNCHROMOUS CODE SAMPLE:
const promptObjects = require('qtools-library-dot-d')({ libraryName: 'promptObjects', }); promptObjects.setLibraryPath(path.join(__dirname, 'prompts.d'));
const passThroughParameters = {}; promptObjects.loadModules({ passThroughParameters }); promptObjects.seal(); //make the library immutable