npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nv-macro-simple-goto

v0.0.2

Published

nv-macro-simple-goto ===================== - nv-macro-simple-goto is a simple macro-tool, to let you use GOTO in javascript - cli tool - it has 7 keywords - ##goto\_blk {...} mark as a goto-block - ##goto\_is\_from(label) prev-goto-entry-la

Readme

nv-macro-simple-goto

  • nv-macro-simple-goto is a simple macro-tool, to let you use GOTO in javascript
  • cli tool
  • it has 7 keywords
  • ##goto_blk {...} mark as a goto-block
  • ##goto_is_from(label) prev-goto-entry-label
  • ##goto(label) goto the goto-entry-block-of-
  • ##goto_next() goto the next-goto-entry-block, if curr-goto-entry-block is last, sameas ##goto_end()
  • ##goto_prev() goto the prev-goto-entry-block, if curr-goto-entry-block is first,same as ##goto_end()
  • ##goto_fst() goto the first-goto-entry-block
  • ##goto_lst() goto the last-goto-entry-block
  • ##goto_end() end-and-exit nearest(parent)-goto-block

install

  • npm install nv-macro-simple-goto -g

usage

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


        ......
            function tst(s) {
                ##goto_blk {
                    l0:{
                        console.log("l0")
                        if(##goto_is_from(l2)) {
                            ##goto_next();                        //goto l1 AND ##from === l0
                        } else {
                            ##goto(l2)                            //goto l2 AND ##from === l0
                        }
                    }
                    l1: {
                        console.log("l1")
                        ##goto(l3)                                 //goto l3 AND ##from === l1
                    }
                    l2: {
                        console.log("l2")
                        if(##goto_is_from(l3)) {
                            ##goto_next()                         //goto l3 AND ##from === l2
                        } else {
                            ##goto_fst()                          //goto l0 AND ##from === l2
                        }
                    }
                    l3: {
                        console.log("l3")
                        if(##goto_is_from(l1)) {
                            ##goto_prev();                     //goto l2 AND ##from === l3
                        } else {
                            ##goto_lst()                       //goto l4 AND ##from === l3
                        }
                    }
                    l4: {
                        console.log("l4");
                        ##goto_end()                           //stop goto
                    }
                }
            }
        .....

example

 nv_macro_sgoto -i  

input

    function tst(...args) {

        ##goto_blk {
            l0:{
                console.log("l0")
                if(##goto_is_from(l2)) {
                    ##goto_next();                        //goto l1 AND ##from === l0
                } else {
                    ##goto(l2)                            //goto l2 AND ##from === l0
                }
            }
            l1: {
                console.log("l1")
                ##goto(l3)                                 //goto l3 AND ##from === l1
            }
            l2: {
                console.log("l2")
                if(##goto_is_from(l3)) {
                    ##goto_next()                         //goto l3 AND ##from === l2
                } else {
                    ##goto_fst()                          //goto l0 AND ##from === l2
                }
            }
            l3: {
                console.log("l3")
                if(##goto_is_from(l1)) {
                    ##goto_prev();                     //goto l2 AND ##from === l3
                } else {
                    ##goto_lst()                       //goto l4 AND ##from === l3
                }
            }
            l4: {
                console.log("l4");
                ##goto_end()                           //stop goto
            }
        }
    }

press ctrl+D

  • the code will be compiled to:

output

    function tst(...args) {
      ___βgoto_blk: {
        const ___βpcs = ["l0", "l1", "l2", "l3", "l4"];
        let ___βgoto_is_from = -1;
        let ___βdiscriminant = 0;

        ___βgoto_while: while (true) {
          ___βgoto_switch: switch (___βdiscriminant) {
            case 0:
              {
                console.log("l0");

                if (___βgoto_is_from === 2) {
                  ___βdiscriminant = 1;
                  ___βgoto_is_from = 0;
                  break ___βgoto_switch;
                } else {
                  ___βdiscriminant = 2;
                  ___βgoto_is_from = 0;
                  break ___βgoto_switch;
                }
              }

            case 1:
              {
                console.log("l1");
                ___βdiscriminant = 3;
                ___βgoto_is_from = 1;
                break ___βgoto_switch;
              }

            case 2:
              {
                console.log("l2");

                if (___βgoto_is_from === 3) {
                  ___βdiscriminant = 3;
                  ___βgoto_is_from = 2;
                  break ___βgoto_switch;
                } else {
                  ___βdiscriminant = 0;
                  ___βgoto_is_from = 2;
                  break ___βgoto_switch;
                }
              }

            case 3:
              {
                console.log("l3");

                if (___βgoto_is_from === 1) {
                  ___βdiscriminant = 2;
                  ___βgoto_is_from = 3;
                  break ___βgoto_switch;
                } else {
                  ___βdiscriminant = 4;
                  ___βgoto_is_from = 3;
                  break ___βgoto_switch;
                }
              }

            case 4:
              {
                console.log("l4");
                ___βdiscriminant = -1;
                ___βgoto_is_from = 4;
                break ___βgoto_while;
              }

            default:
              {
                break ___βgoto_while;
              }
          }
        }
      }
    }

test

    /* l0->l2->l0->l1->l3->l2->l3->l4->eof 
    > tst()
    l0
    l2
    l0
    l1
    l3
    l2
    l3
    l4
    */

LICENSE

  • ISC