How to use the @node-wot/core/package.json.version function in @node-wot/core

To help you get started, we’ve selected a few @node-wot/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse / thingweb.node-wot / packages / cli / src / cli.ts View on Github external
argv.splice(i, 1);
        i--;

    } else if (argv[i].match(/^(-i|-ib|--inspect(-brk)?(=([a-z]*|[\d .]*):?(\d*))?|\/i|\/ib)$/i)) {
        let matches = argv[i].match(/^(-i|-ib|--inspect(-brk)?(=([a-z]*|[\d .]*):?(\d*))?|\/i|\/ib)$/i)
        debug = {
            shouldBreak: matches[2] === "-brk" || matches[1] === "-ib" || matches[1] === "/ib",
            host: matches[4] ? matches[4] : "127.0.0.1",     // default host
            port: matches[5] ? parseInt(matches[5]) : 9229   // default port
        }

        argv.splice(i, 1);
        i--;

    } else if (argv[i].match(/^(-v|--version|\/c)$/i)) {
        console.log( require('@node-wot/core/package.json').version );
        process.exit(0);

    } else if (argv[i].match(/^(-h|--help|\/?|\/h)$/i)) {
        console.log(`Usage: wot-servient [options] [SCRIPT]...
       wot-servient
       wot-servient examples/scripts/counter.js examples/scripts/example-event.js
       wot-servient -c counter-client.js
       wot-servient -f ~/mywot.conf.json examples/testthing/testthing.js

Run a WoT Servient in the current directory.
If no SCRIPT is given, all .js files in the current directory are loaded.
If one or more SCRIPT is given, these files are loaded instead of the directory.
If the file 'wot-servient.conf.json' exists, that configuration is applied.

Options:
  -v,  --version                   display node-wot version
github eclipse / thingweb.node-wot / packages / demo-servients / src / bridge-cli.ts View on Github external
} else if (flagArgPassword) {
            flagArgPassword = false;
            password = arg;
            argv.shift();

        } else if (arg.match(/^(-f|--configfile|\/f)$/i)) {
            flagArgConfigfile = true;
            argv.shift();

        } else if (arg.match(/^(-p|--password|\/p)$/i)) {
            flagArgPassword = true;
            argv.shift();

        } else if (arg.match(/^(-v|--version|\/c)$/i)) {
            console.log(require('@node-wot/core/package.json').version);
            process.exit(0);

        } else if (arg.match(/^(-h|--help|\/?|\/h)$/i)) {
            console.log(`Usage: bridge-servient [options] [SCRIPT]...
       bridge-servient
       bridge-servient examples/scripts/counter.js examples/scripts/example-event.js
       bridge-servient -f ~/mybridge.conf.json testthing.js
       bridge-servient -p myOracleSecret

Run a WoT Servient in the current directory.
If no SCRIPT is given, all .js files in the current directory are loaded.
If one or more SCRIPT is given, these files are loaded instead of the directory.
If the file 'bridge-servient.conf.json' exists, that configuration is applied.

Options:
  -v, --version           display node-wot version