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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nv-cli-unsum-int

v1.0.3

Published

nv-cli-unsum-int ================ - cli-tool - split a int(capacity) to sum-of-ints(subtype | incomplete-subtype-prefix | incomplete-subtype-suffix) - please see the examples below - the tool is USED to generate switch case

Downloads

7

Readme

nv-cli-unsum-int

  • cli-tool
  • split a int(capacity) to sum-of-ints(subtype | incomplete-subtype-prefix | incomplete-subtype-suffix)
  • please see the examples below
  • the tool is USED to generate switch case

install

  • npm install nv-cli-unsum-int -g

usage

	Usage: nv_cli_unsum_int [options] 
	Options:
	    -c, --capacity                  capactity  int >0
	    -t, --types                     
		     type-name length type-name length .....;
			type-name must be valid js-identifier           AND 
			type-name CANT includes lodash "_"              AND
			type-name CANT includes dollar "$"              

	    -i, --include_incomplete        include incomplete prefix_types and suffix_types,     default false
	    -p, --permit_padding            permit padding: the-sum-of-subtype-must-eq-capacity,  default false
	    -h, --help                      usage

example

split a-type-of-length-6 to sub-type-of-4 and sub-type-of-2; disallow-padding AND disallow-incomplete-type

        #nv_cli_unsum_int -c 6 -t U4 4 U2 2  

	{
	  capacity: 6,
	  subtyped: { 
        	 U4_U2:    [ 4, 2 ], 
     		 U2_U4:    [ 2, 4 ], 
		 U2_U2_U2: [ 2, 2, 2 ] 
	  }
	}

split a-type-of-length-6 to sub-type-of-4 and sub-type-of-2; allow-padding BUT disallow-incomplete-type

        #nv_cli_unsum_int -c 6 -t U4 4 U2 2 -p  

			{
			  capacity: 6,
			  subtyped: {
			    U4: [ 4 ],
			    U4_U2: [ 4, 2 ],
			    U2: [ 2 ],                    //---need-padding  
			    U2_U4: [ 2, 4 ],
			    U2_U2: [ 2, 2 ],              //---need-padding  
			    U2_U2_U2: [ 2, 2, 2 ]
			  }
			}

split a-type-of-length-6 to sub-type-of-4 and sub-type-of-2; allow-padding AND allow-incomplete-type

        #nv_cli_unsum_int -c 6 -t U4 4 U2 2 -p -i 

	{
	  capacity: 6,
	  subtyped: {
	    U4: [ 4 ],
	    U4_U2: [ 4, 2 ],
	    'U4_U4$2_': [ 4, 2 ],                  // incomplete at tail 
	    U2: [ 2 ],
	    '_U4$2': [ 2 ],                        // incomplete at head  AND need padding
	    U2_U4: [ 2, 4 ],
	    '_U4$2_U4': [ 2, 4 ],                  //  incomplete at head
	    U2_U2: [ 2, 2 ],
	    '_U4$2_U2': [ 2, 2 ],                  // incomplete at head AND need padding
	    U2_U2_U2: [ 2, 2, 2 ],
	    'U2_U2_U4$2_': [ 2, 2, 2 ],             // incomplete at tail 
	    '_U4$2_U2_U2': [ 2, 2, 2 ],             //incomplete at head 
	    '_U4$2_U2_U4$2_': [ 2, 2, 2 ]           // incomplete BOTH at head AND at tail
	  }
	}

split a-type-of-length-6 to sub-type-of-4 and sub-type-of-2; disallow-padding AND allow-incomplete-type

        #nv_cli_unsum_int -c 6 -t U4 4 U2 2 -i


		{
		  capacity: 6,
		  subtyped: {
		    U4_U2: [ 4, 2 ],
		    'U4_U4$2_': [ 4, 2 ],
		    U2_U4: [ 2, 4 ],
		    '_U4$2_U4': [ 2, 4 ],
		    U2_U2_U2: [ 2, 2, 2 ],
		    'U2_U2_U4$2_': [ 2, 2, 2 ],
		    '_U4$2_U2_U2': [ 2, 2, 2 ],
		    '_U4$2_U2_U4$2_': [ 2, 2, 2 ]
		  }
		}

LICENSE

  • ISC