If you are using npm (the Node.js package manager) always ensure that your npm is up-to-date by running:
npm update -g npm
Then use:
npm install izymodtask
This tool provides libraries for traditional modtask izyware apps. You may use the libraries by referencing the node_modules folder.
When integrating izyware modtask style components to native node runtime apps and you need to ldmod on a module, you can:
`
var mod = require('izymodtask').getRootModule(dir, moduleSearchPaths).ldmod('pathtomodule');
`
The paramater are optional and are used for the following purpose:
contextualName
for the rootmodule. If not specified, it will be set to the dirname for the current izymodtask installation (not the caller).To see what the module resolution paths are for the context that you are using the code above, you can always use:
`
require('izymodtask').getRootModule().ldmod('s_root').cmdlineverbs.sysview();
`
If you need to launch cmdline based verbs from the node app, use the following syntax:
`
require('izymodtask').runCmd('sysview -- or your verb --')
`
When the verb is called inside the g_handler
module, you can extract the command line config by:
`
modtask.cmdlineverbs.method = function() {
var config = modtask.ldmod('izymodtask/index').extractConfigFromCmdLine('method');...
`
You can customize the izyware modtask search path by creating the following:
`
modtask/config/kernel/extstores/file.js
`
in the root of your node app.
Note: Current Directory = CD, IzyModtask Directory = ID, Thirdparty Components Directory = TD
Consider the following setup
CD = /tmp/curdir
ID = /plat/p/izymodtaskTD = /tmp/izymodtaskapp
node TD/test.js
rm -rf /tmp/izymodtaskpathtest;
mkdir -p /tmp/izymodtaskpathtest/curdir;mkdir -p /tmp/izymodtaskpathtest/app;
mkdir -p /tmp/izymodtaskpathtest/thirdpartylib; clear; cp -r /plat/p/izymodtask/izymodtaskpathtest/* /tmp/izymodtaskpathtest;cd /tmp/izymodtaskpathtest/curdir;node ../app/main.jsThis is very a typical use case where a thirdparty app that uses izymodtask, is launched from a random location in the system. We will analyze the following scenarios:
That is the reason why contextualName
was introduced in the later version to be able to 'position' the rootModule.
['chain.importProcessor', ':test/assert/chain'],
* will help debugging and investigating modtask related issues.
./ldo.sh mship izy-proxy/izymodtask/build;cp ../build/payloads/build/izymodtask/entrypoint/ljs.js ../izy-proxy/izymodtask/bootstrap.js
* Kernel.rootModule.usermodule.getModuleSearchPaths was added
* rootModule can now take an array* this will make the modtask/... kernel/extstores/file optional and allow more flexibility in reusing existing modules in different contexts
* add this to your module:
/ izy-loadobject nodejs-require /
...module.exports = modtask;
./ldo.sh mship izymodtask/build;cp ../build/payloads/build/izymodtask/entrypoint/ljs.js ../izymodtask/ljs.js;
cp modtask/kernel/mod.js ../izymodtask/kernel;cp modtask/kernel/path.js ../izymodtask/kernel;* it will allow doing node style require using relative paths to the current izy module.
* this will alleviate the paths and search problems that customers have reported in the past