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

function-stack

v0.0.2

Published

function-stack ==============

Downloads

29

Readme

function-stack

a simple stack for executing js functions.

on initialization, the stack takes in a list of functions, appends them to the stack, and executes them.

when a function is pushed into the stack, it is immediately popped off and executed.

the application use for something like this is a remote script that contains a library function needed. create a list of function calls, then when the lib is loaded, run through them

this was inspired by googletag's command array.

ex: local script

var fns = [];
fns.push(function() {
  notImplemented();
});

remote script

function notImplemented() {
  alert('implemented\!')
}

fns = FunctionStack(fns);

and example html test:

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>A friendly example</title>

  <!-- need to load FunctionStack -->
  <script src="../dist/fs.min.js"></script>
</head>
  <body>
    <script>

      window['_namespace'] = window['_namespace'] || {};

      // first push fn to stack
      window['_namespace'].fns = [];
      window['_namespace'].fns.push(function() {
        window['_namespace'].notImplemented();
      });
    </script>

    <script>
      // now load lib
      setTimeout(function() {

        window['_namespace'] = window['_namespace'] || {};

        window['_namespace'].notImplemented = function() {
          alert('implemented!');
        };
        // then turn array to FunctionStack
        window['_namespace'].fns = FunctionStack(window['_namespace'].fns);
      }, 500);
    </script>
  </body>
</html>

license

the command array samples are released under apache 2.0 license so this will as well.

errata

an important thing to note is that the functions that are coming in from the remote script must be available in the global window usually recommended to set a namespace for the functions so that they don't interfere

this was designed to be used in an ad serving environment