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

godkits

v0.0.2

Published

an interesting js utils

Downloads

3

Readme

Introduction:

God-specific javascript utils

Installation:

npm i godkits

Import:

let Godkits = require('godkits');

API:

Godkits.dissolveObject(obj)

  • obj <object>
  • Returns <array>

a method to dissolve an object, and then return an array which contains keys and values of the object, even if the value is still an object or an array

let obj = {
    a: "b",
    c: {
        d: "e",
        f: {
            g: "h",
            i: function () {
                console.log("haha");
            },
            j: [[[[["k"]]]], ["l", [["m"]], "n"]]
        }
    }
}

console.log(Godkits.dissolveObject(obj));

// [ 'a',  'b',  'c',  'd',  'e',  'f',  'g',  'h',  'i',  [Function: i],  'j',  'k',  'l',  'm',  'n' ]

Godkits.flatArray(arr)

  • arr <array>
  • Returns <array>

a method to flat an array

let a = [[[[1, 2], 3], 4], 5, [6, [7, [[8, [[[[9]]]]]]], [10]]];
console.log(Godkits.flatArray(a));

// [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]

Godkits.sleep(milliseconds)

  • milliseconds <number>
  • Returns <void>

a blocking sleep method

console.log(new Date());
Godkits.sleep(3000);
console.log(new Date());

// 2019-04-19T09:54:03.163Z
// 2019-04-19T09:54:06.167Z

Godkits.countDown(callback, milliseconds)

  • callback <function>
  • milliseconds <number>
  • Returns <void>

a more intuitionistic method to invoke the callback later than the native timeout method

function logTime() {
    console.log("  end time: " + new Date());
}
// native timeout method (notice the end time below)

console.log("start time: " + new Date());
setTimeout(logTime, 3000);
setTimeout(logTime, 3000);
setTimeout(logTime, 3000);

// start time: Fri Apr 19 2019 18:07:52 GMT+0800 (GMT+08:00)
//   end time: Fri Apr 19 2019 18:07:55 GMT+0800 (GMT+08:00)
//   end time: Fri Apr 19 2019 18:07:55 GMT+0800 (GMT+08:00)
//   end time: Fri Apr 19 2019 18:07:55 GMT+0800 (GMT+08:00)
// Godkits' countDown method (notice the end time below)

console.log("start time: " + new Date());
Godkits.countDown(logTime, 3000);
Godkits.countDown(logTime, 3000);
Godkits.countDown(logTime, 3000);

// start time: Fri Apr 19 2019 18:21:59 GMT+0800 (GMT+08:00)
//   end time: Fri Apr 19 2019 18:22:02 GMT+0800 (GMT+08:00)
//   end time: Fri Apr 19 2019 18:22:05 GMT+0800 (GMT+08:00)
//   end time: Fri Apr 19 2019 18:22:08 GMT+0800 (GMT+08:00)

Godkits.addInterval(intervalName, callback, milliseconds)

  • intervalName <string>
  • callback <function>
  • milliseconds <number>
  • Returns <boolean>

a method looks like the native setInterval(), but more humanizing

// native interval method
let haha = setInterval(() => { console.log("haha"); }, 3000);
clearInterval(haha);

// Godkits interval method
Godkits.addInterval("haha", () => { console.log("haha"); }, 3000);
Godkits.clearInterval("haha");

Godkits.clearInterval(intervalName)

  • intervalName <string>
  • Returns <boolean>

a method looks like the native clearInterval(), but more humanizing

// native interval methods
let haha = setInterval(() => { console.log("haha"); }, 3000);
clearInterval(haha);

// Godkits interval methods
Godkits.addInterval("haha", () => { console.log("haha"); }, 3000);
Godkits.clearInterval("haha");

Godkits.randomSample(sample, number)

  • sample <array>
  • array <number>
  • Returns <array>

a method to return a shuffled (subset) array of the sample array

let a = [1, 2, 3, 4, 5, 6, 7, 8, 9];
console.log(Godkits.randomSample(a, 6));
// [ 5, 6, 8, 2, 9, 4 ]
console.log(Godkits.randomSample(a, 3));
// [ 3, 7, 1 ]