1.0.4 • Published 2 years ago

nv-cli-sradio v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

nv-cli-sradio

  • nv-cli-sradio
  • cli tool, creat a Radio class template

install

  • npm install nv-cli-sradio -g

usage

    Usage: nv_cli_sradio [options]
    Options:
        -n, --name           class name default _Radio
        -p, --options        option values
        -h, --help           usage

example

    nv-cli-sradio# nv_cli_sradio -n Test -p a 100 "'100'" xyz

        class Test {
            #val = "a"
            #idx = 0
            get val_() {return(this.#val)}
            get idx_() {return(this.#idx)}

            slct_a()  {
                this.#val = "a";
                this.#idx = 0;
                return(this.#val)
            }
            ////

            slct_100()  {
                this.#val = 100;
                this.#idx = 1;
                return(this.#val)
            }
            ////

            slct_100_str()  {
                this.#val = "100";
                this.#idx = 2;
                return(this.#val)
            }
            ////

            slct_xyz()  {
                this.#val = "xyz";
                this.#idx = 3;
                return(this.#val)
            }

            get [Symbol.toStringTag]() {
                return(JSON.stringify(this.#val))
            }
        }
        ////
        Test.ks = ["a","100","100","xyz"];
        Test.vs = ["a",100,"100","xyz"];
        Test.ts = ["str","int","str","str"];
        Test.ns = ["a","100","100_str","xyz"];

test

    /*
    > var radio = new Test()

    > radio
    Test ["a"] {}
    > radio.slct_
    radio.slct_100      radio.slct_100_str  radio.slct_a        radio.slct_xyz

    > radio.slct_100_str()
    '100'
    > radio
    Test ["100"] {}
    >
    > radio.slct_100()
    100
    >
    > radio
    Test [100] {}
    >

    */

LICENSE

  • ISC