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-random-fixed-key-json

v1.0.4

Published

nv-random-fixed-key-json ======================= - creat a random json based on provided template - the key is fixed

Readme

nv-random-fixed-key-json

  • creat a random json based on provided template
  • the key is fixed

install

  • npm install nv-random-fixed-key-json

usage

  const creat   = require("nv-random-fixed-key-json");

example

provide a template

	// null means any  string|number|boolean
	var tmpl = {
	    a: [true,false,{k0:0,k1:'this-is-astring',k2:null,k3:null}],
	    d: {
		inner_ary: [null,null,null,null],
		using_self_defined_func: {
		    f0: ()=>creat._rndsen.NIJ_,
		    f1: ()=>creat._rndnum.zto255()
		}
	    } 
	}

show shape:

  • 0 means number
  • "" means string
  • true means bool
  • null means any-leaf OR will-be-created-by-self-defined-function

	var seed = creat(tmpl);
	/*
		> seed.shape_
		{
		  a: [ true, true, { k0: 0, k1: '', k2: null, k3: null } ],
		  d: {
		    inner_ary: [ null, null, null, null ],
		    using_self_defined_func: { f0: null, f1: null }
		  }
		}
		> 
	*/

random

		/*
		> seed.rnd()
		{
		  a: [
		    false,
		    false,
		    {
		      k0: -1577065664.2114193,
		      k1: 'lacquer_placate_bioluminescence',
		      k2: 'literati_mesmerize_calvary',
		      k3: 3479652019428528
		    }
		  ],
		  d: {
		    inner_ary: [
		      -3326334884.9893923,
		      -608724603587028,
		      true,
		      'ironstone_womanize_mansion'
		    ],
		    using_self_defined_func: { f0: 'ionosphere_delaminate_kaput', f1: 52 }
		  }
		}
		> seed.rnd()
		{
		  a: [
		    true,
		    false,
		    {
		      k0: -100503561.28671879,
		      k1: 'containerboard_gallicize_tablature',
		      k2: -1415965327.7500594,
		      k3: 1268869376.694359
		    }
		  ],
		  d: {
		    inner_ary: [ 1645645331.790306, -4753162672601536, false, 4021496365.872095 ],
		    using_self_defined_func: { f0: 'tuber_jaywalk_impeccable', f1: 39 }
		  }
		}
		> seed.rnd()
		{
		  a: [
		    true,
		    true,
		    {
		      k0: -3724531685.610876,
		      k1: 'pepper_backfill_cheaters',
		      k2: 'marathoner_banter_rotunda',
		      k3: true
		    }
		  ],
		  d: {
		    inner_ary: [
		      -4275275379.9080243,
		      'climber_haul_dinnerware',
		      -587470466.794957,
		      false
		    ],
		    using_self_defined_func: { f0: 'takeover_descend_accidental', f1: 179 }
		  }
		}
		> seed.rnd()
		{
		  a: [
		    true,
		    false,
		    {
		      k0: 6634654400107992,
		      k1: 'lightning_disjoin_speechmaker',
		      k2: true,
		      k3: 'milt_enlighten_clarence'
		    }
		  ],
		  d: {
		    inner_ary: [ false, -3166452468.1757603, true, 'lenape_pulverize_maths' ],
		    using_self_defined_func: { f0: 'vinegarroon_knelt_healthy', f1: 166 }
		  }
		}
		> seed.rnd()
		{
		  a: [
		    false,
		    false,
		    {
		      k0: -7859732858932384,
		      k1: 'vindaloo_writhe_lavation',
		      k2: false,
		      k3: 1225255999924492
		    }
		  ],
		  d: {
		    inner_ary: [
		      true,
		      -8670600011820196,
		      -1794753347.6321335,
		      'vasoinhibitor_move_lustring'
		    ],
		    using_self_defined_func: { f0: 'isotherm_hearken_circumstantial', f1: 109 }
		  }
		}
		> seed.rnd()
		{
		  a: [
		    true,
		    false,
		    {
		      k0: -1663924305.7470028,
		      k1: 'actinium_mercurate_betaine',
		      k2: false,
		      k3: -2314763251.6839366
		    }
		  ],
		  d: {
		    inner_ary: [ 'veg_spurn_northeast', false, false, false ],
		    using_self_defined_func: { f0: 'mainstay_collude_elegiac', f1: 156 }
		  }
		}
		> 
		*/

METHODS

seed.child                                   seed.constructor                             seed.des_rnd_funcs_                          seed.get_child_rnd_func                      seed.i_
seed.init_as_ele_ary                         seed.init_as_ele_dict                        seed.init_as_ele_leaf                        seed.init_as_prop_ary                        seed.init_as_prop_dict
seed.init_as_prop_leaf                       seed.init_as_root_ary                        seed.init_as_root_dict                       seed.init_as_root_leaf                       seed.is_ele
seed.is_prop                                 seed.is_rt                                   seed.k_                                      seed.nm_                                     seed.plget
seed.plget_rnd_func                          seed.plset_rnd_func                          seed.rnd                                     seed.shape_                                  seed.visit_and_set_rnd_func

APIS

	creat._creat_forest_with_params  creat._creat_if_ary              creat._creat_if_dict             creat._init                      creat._rndbl                     creat._rndnum                    creat._rndsen
	creat._rndstr                    creat.dflt_rnd_any               creat.dflt_rndb                  creat.dflt_rndf                  creat.dflt_rnds                  creat.length                     creat.name
	creat.rnd_leaf_based_on_v

LICENSE

  • ISC