npm.io
1.1.0 • Published 4 years ago

tec_node_variables

Licence
ISC
Version
1.1.0
Deps
0
Size
2 kB
Vulns
0
Weekly
0

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'}]

Keywords