jpex-node
Default factories for Jpex in a node environment
Installation
npm install jpex-node --save
Usage
const Jpex = ;const jpexNode = ;Jpex; // We now have access to more goodiesconst $fs = Jpex; Jpexregister;
API
jpex-node automatically includes all factories from the jpex-defaults plugin, plus a few extras:
$fs
$fs is a wrapper around Node's File System module (fs).
Any method that would normally take a callback has been converted into a promise using the $promise
factory.
var MyClass = jpex;
$tick
$tick(callback)
$tick
calls the callback function on the next available event loop. This is the equivalent of process.nextTick
.
node_module
Class.register.node_module(name)
This is just a short cut for injecting a node module. Normally Jpex's resolver looks through all inherited factories, decorators, named parameters, etc. until it finally decides to look in the node_modules folder. Registering a node_module tells Jpex where to look straight away.
Classregister;var path = Class;