# nv-cli-cls

> cli-tool,to generate class template

Latest version **1.0.12** (published 2021-06-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-cli-cls
pnpm add nv-cli-cls
yarn add nv-cli-cls
bun add nv-cli-cls
```

Provides the commands `nv_cls_ext`, `nv_cls_tem`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2021-06-19 |
| First published | 2021-06-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 26.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |
| Keywords | cli, class, template, extends |

## Links

- npm: https://www.npmjs.com/package/nv-cli-cls
- npm.io page: https://npm.io/package/nv-cli-cls

## Dependencies (5)

- [nv-cli-basic](https://npm.io/package/nv-cli-basic.md) ^1.0.5
- [nv-data-tree-loadump](https://npm.io/package/nv-data-tree-loadump.md) ^1.0.5
- [nv-data-tree-csp-node](https://npm.io/package/nv-data-tree-csp-node.md) ^1.0.3
- [nv-data-tree-csp-forest](https://npm.io/package/nv-data-tree-csp-forest.md) ^1.0.18
- [@babel/helper-validator-identifier](https://npm.io/package/@babel/helper-validator-identifier.md) ^7.14.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.12 (latest) — 2021-06-19
- 1.0.11 — 2021-06-19
- 1.0.10 — 2021-06-10
- 1.0.9 — 2021-06-10
- 1.0.8 — 2021-06-10
- 1.0.7 — 2021-06-10
- 1.0.6 — 2021-06-10
- 1.0.5 — 2021-06-10
- 1.0.3 — 2021-06-10
- 1.0.2 — 2021-06-10
- 1.0.1 — 2021-06-10

## README

nv-cli-cls
===============
- nv-cli-cls    
- cli tool, quickly generate class template 


install
=======
- npm install nv-cli-cls -g 

usage
=====

extends
-------

    APPS# nv_cls_ext -h
    Usage: nv_cls_ext [options]
    Options:
        -n, --name          root class name,default 'Cls'
        -i, --input         input json cfg file,default stdin
        -o, --output        output js file,default stdout
        -h, --help          usage
    
    APPS#
    
    
    APPS# nv_cls_ext -n Root
   
    //----paste a dict here
    
    {
        A:{
            C:{},
            "@xyz":{}
        },
        B:{
            C:{},
            D:{E:null}
        }
    }
    
    //----press ctrl+D
    
    const INVALID_NAME = {
        "_64_120_121_122": "@xyz"
    }
    
    class Root {}
    
    class A extends Root {}
    
    class C extends A {}
    
    class _64_120_121_122 extends A {}
    
    class B extends Root {}
    
    class C$1_0 extends B {}
    
    class D extends B {}
    
    class E extends D {}
    
    
    APPS#


template
--------

    APPS# nv_cls_tem -h
    Usage: nv_cls_tem [options]
    Options:
        -n, --name            class name default 'Cls'
        -p, --property        property,getter,setter
            -m, --method          methods
            -h, --help            usage
        
        ---------------------
        
            begin with # : private,                           such as #priv0 ;
            @cls         : static,                            such as prop@cls, #prop@cls;
            @sym         : treat as symbol,                   such as prop@sym ;
            @com         : computed, will be enclosed by [ ], such as Symbol.toStringTag@com;
            @get         : getter ,                           such as prop_@get;
            @set         : setter ,                           such as prop_@set;
        
        APPS#
    
    
### 1
    nv_cls_tem -n MyCls -p "#priv0" pub0 P@cls -m "#pf0" f0 F@cls
    
    
    class MyCls {
    
        //static public property:
        static P = undefined;
    
        //static public method:
        static F(/*...args*/) {/*...*/}
    
        //instance private prop:
        #priv0 = undefined;
    
        constructor(/*...args*/) {
    
            //instance public property:
            this.pub0 = undefined;
    
    
        }
    
        //instance private method:
        #pf0(/*...args*/) {/*...*/}
    
        //instance public method:
        f0(/*...args*/) {/*...*/};
    
    
    }
    
    
    
### 2
    nv_cls_tem -n MyCls -p length@get max_length@set@get  -m x y
    
    class MyCls {
    
        //instance private prop:
        #length = undefined;
        #max_length = undefined;
    
    
        constructor(/*...args*/) {
    
        }
    
    
        //instance public getter:
        get length (){return(this.#length)}
        get max_length (){return(this.#max_length)}
    
    
        //instance public setter:
        set max_length (v){this.#max_length=v};
    
    
        //instance public method:
        x(/*...args*/) {/*...*/};
        y(/*...args*/) {/*...*/};
    
    
    }
    
    
    
### 3
    nv_cls_tem -n MyCls -p sym_get@sym@get P@cls -m func0  func1
    
    
    //symbol-dict:
    const SYM_DICT = {
        "sym_get":Symbol("sym_get")
    }
    
    
    
    class MyCls {
    
        //static public property:
        static P = undefined;
    
    
        //instance private prop:
        #sym_get = undefined;
    
    
        constructor(/*...args*/) {
    
        }
    
    
        //instance public getter:
        get [MyCls.SYM_DICT["sym_get"]]() {return(this.#sym_get)}
    
    
        //instance public method:
        func0(/*...args*/) {/*...*/};
        func1(/*...args*/) {/*...*/};
    
    
    }
    
    
    //add SYM_DICT to class:
    MyCls.SYM_DICT=SYM_DICT;
    
    
    
    ### 4
    nv_cls_tem -n MyCls -p "#priv0" "#priv1" pub0 pub1 -m "#pf0" "#pf1" f0 f1
    
    
    class MyCls {
    
        //instance private prop:
        #priv0 = undefined;
        #priv1 = undefined;
    
    
        constructor(/*...args*/) {
    
            //instance public property:
            this.pub0 = undefined;
            this.pub1 = undefined;
    
    
        }
    
    
        //instance private method:
        #pf0(/*...args*/) {/*...*/}
        #pf1(/*...args*/) {/*...*/}
    
    
        //instance public method:
        f0(/*...args*/) {/*...*/};
        f1(/*...args*/) {/*...*/};
    
    
    }
    

### 4




    nv_cls_tem -n MyCls -p  pub0@com pub1@sym  -m f0@com f1@com

    //symbol-dict:
    const SYM_DICT = {
        "pub1":Symbol("pub1")
    }



    class MyCls {

        constructor(/*...args*/) {

            //instance public property:
            this[pub0] = undefined;
            this[MyCls.SYM_DICT["pub1"]] = undefined;


        }


        //instance public method:
        [f0](/*...args*/) {/*...*/};
        [f1](/*...args*/) {/*...*/};


    }


    //add SYM_DICT to class:
    MyCls.SYM_DICT=SYM_DICT;




LICENSE
=======
- ISC

---
_Source: https://npm.io/package/nv-cli-cls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
