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

@jrvieira/graphene

v1.1.1

Published

cli graphs

Downloads

6

Readme

graphene

cli graphs

Installation

npm i @jrvieira/graphene

Usage

graphene produces a cli graph based on a collection of samples from a function that returns a number

/* sample.js */

const graphene = require('@jrvieira/graphene')

// grab command line argument as the number of samples
let n = Number(process.argv[2]) || undefined

// return a pseudo-random number
function boxmuller () {
	
    let u = Math.random()
    let v = Math.random()

    return Math.floor(10 * Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v))
}

// using the Box-Muller transform, a normal distribution is expected
graphene(boxmuller, n)

Running:

node sample 1000000 -amp

Prints similar to:

-50 |                                                                                            2
-49 |                                                                                            1
-48                                                                                          
-47                                                                                          
-46 |                                                                                            1
-45 |                                                                                            1
-44 |                                                                                            1
-43 |                                                                                            7
-42 |                                                                                            5
-41 |                                                                                           16
-40 |                                                                                           16
-39 |                                                                                           19
-38 |                                                                                           33
-37 |                                                                                           51
-36 |                                                                                           71
-35 |                                                                                          114
-34 |                                                                                          158
-33 |                                                                                          206
-32 |                                                                                          287
-31 |                                                                                          395
-30 ||                                                                                         512
-29 ||                                                                                         678
-28 |||                                                                                        950
-27 |||                                                                                       1193
-26 ||||                                                                                      1575
-25 |||||                                                                                     1993
-24 |||||||                                                                                   2525
-23 ||||||||                                                                                  3263
-22 ||||||||||                                                                                3961
-21 ||||||||||||                                                                              4759
-20 |||||||||||||||                                                                           6012
-19 ||||||||||||||||||                                                                        7304
-18 ||||||||||||||||||||||                                                                    8854
-17 |||||||||||||||||||||||||                                                                10092
-16 |||||||||||||||||||||||||||||                                                            12037
-15 ||||||||||||||||||||||||||||||||||                                                       13908
-14 |||||||||||||||||||||||||||||||||||||||                                                  15973
-13 ||||||||||||||||||||||||||||||||||||||||||||                                             18388
-12 ||||||||||||||||||||||||||||||||||||||||||||||||||                                       20543
-11 |||||||||||||||||||||||||||||||||||||||||||||||||||||||                                  22934
-10 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||                            25360
 -9 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||                       27927
 -8 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||                   30147
 -7 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||               32166
 -6 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||            34118
 -5 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||         36001
 -4 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||       37277
 -3 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||     38451
 -2 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||    39582
 -1 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||   39788
  0 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||   39757
  1 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||    39562
  2 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||     38721
  3 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||       37680
  4 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||         35702
  5 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||            34543
  6 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||               32150
  7 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||                   30118
  8 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||                       27764
  9 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||                            25420
 10 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||                                 23039
 11 ||||||||||||||||||||||||||||||||||||||||||||||||||                                       20626
 12 ||||||||||||||||||||||||||||||||||||||||||||                                             18329
 13 |||||||||||||||||||||||||||||||||||||||                                                  16160
 14 ||||||||||||||||||||||||||||||||||                                                       14056
 15 |||||||||||||||||||||||||||||                                                            11876
 16 |||||||||||||||||||||||||                                                                10344
 17 |||||||||||||||||||||                                                                     8604
 18 ||||||||||||||||||                                                                        7282
 19 |||||||||||||||                                                                           6050
 20 ||||||||||||                                                                              4794
 21 ||||||||||                                                                                3954
 22 ||||||||                                                                                  3171
 23 ||||||                                                                                    2445
 24 |||||                                                                                     1974
 25 ||||                                                                                      1580
 26 |||                                                                                       1195
 27 |||                                                                                        921
 28 ||                                                                                         668
 29 ||                                                                                         502
 30 |                                                                                          373
 31 |                                                                                          288
 32 |                                                                                          213
 33 |                                                                                          141
 34 |                                                                                          133
 35 |                                                                                           59
 36 |                                                                                           52
 37 |                                                                                           28
 38 |                                                                                           27
 39 |                                                                                           16
 40 |                                                                                            9
 41 |                                                                                           10
 42 |                                                                                            3
 43 |                                                                                            2
 44 |                                                                                            1
 45                                                                                          
 46 |                                                                                            1
 47                                                                                          
 48 |                                                                                            1

Arguments

graphene(f, s, r)

Flags (cli)

More examples

Check the examples folder for a positive-skew distribution of a collector's probability of completing a set at random and a crude brute force attempt at the 25 Horses Puzzle:

node examples/collect -amp
node examples/25hp
Licensed under MIT