tec_node_variables
v1.1.0
Published
This is a module for the node args. These are parsed into an object or an array of objects
Downloads
3
Readme
tecNodeVariables
This is a module for the node args. These are parsed into an object or an array of objects
Use
npm i --save tecNodeVariables
let tecNode = require("tecNodeVariables");
// Here you can either specify an object with the variable keys or the default is set -> ["-s", "-w"]
const tec = new tecNode(["-s", "-w", "-r"]);
// Add a variable to the array
tec.addVariable("-i")
// Overwrites all existing variables
tec.setVariables(["-i", "-h"]);
// To get all variables
let variables = tec.getVariables();
// Search returns a object
let test = tec.search("-v")
console.log("test: ", test);
// Example: { '-v' : 'test' }
or
let test = tec.search()
console.log("test: ", test);
// Example: [{ '-v' : 'test' }, { '-i', 'test2'}]