0.0.2 • Published 2 years ago

nv-cli-remove-sync-await v0.0.2

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

nv-cli-remove-sync-await

  • nv-cli-remove-sync-await is a simple cli-tool
  • find AwaitExpression AND for await...of IN input
  • and Check along their ancestors func/method/lambda
  • IF is NOT async , REMOVE await

install

  • npm install nv-cli-remove-sync-await -g

usage

    Usage: nv_remove_sync_await [options]
    Options:
        -i, --input         input string ,default stdin
        -o, --output        output string,default stdout
        -h, --help          usage

example

   # nv_remove_sync_await



    r=>()=>{await 8}


    //// ===>press ctrl+D

    r => () => {
      8;
    };

    # nv_remove_sync_await

    function tst() { return(await 2)}

    //----press ctrl+D

    function tst() {
      return 2;
    }

    # nv_remove_sync_await

    function tst() {
        for(let i=0;i<5;i++) {
                    for await(let ele of g) {
                    }
            }
    }



    //----press ctrl+D





    function tst() {
      for (let i = 0; i < 5; i++) {
        for (let ele of g) {}
      }
    }

    # nv_remove_sync_await


    class Cls {
            static smethod () {
                    while(true) {
                            d[await 3] = 100;
                    }
            }
        method() {
                    await 100
            }
    }


    //----press ctrl+D

    class Cls {
      static smethod() {
        while (true) {
          d[3] = 100;
        }
      }

      method() {
        100;
      }

    }

    # nv_remove_sync_await





       function tst() {
               {
                       var o = {
                               method() {
                                       return(await 100)
                               }
                       }
                       function inner() {
                               await 200
                       }
                       {
                       function inner2() {
                                               for await(let a of g) {}
                                       }
                       }
                       {d[await 3] = 100;}
               }
       }



    //===>press ctrl+D

    function tst() {
      {
        var o = {
          method() {
            return 100;
          }

        };

        function inner() {
          200;
        }

        {
          function inner2() {
            for (let a of g) {}
          }
        }
        {
          d[3] = 100;
        }
      }
    }

LICENSE

  • ISC