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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bob-standard

v0.2.5

Published

bobs standard library with basic stuff

Readme

Bobs standard library for node.js

This is my personal standard library with handy functions I find myself declaring far too often. Please don't expect anything enormous. The library is 100% dependency-free as I want to keep the learning effect I experience while implementing algorithms from scratch. Implementations done by other developers I copied / modified are unambiguously marked as such.

Getting started

First, get over to your terminal and install this library with this command:

npm i bob-standard

To include this library into your node.js project, simply require it like so:

const bob = require('bob-standard')

Thats all! Now you have access to all provided functions. Please note that this is just my personal library, I may change content without warning which could make your project thow unexpected errors. If anything strange happens, please report an issue.

Notes

The method Reaction.balance() does not work properly at this time. It will be updated shortly.

Example usage

Here are a few examples using functions included in this library. For details on each available method, please check out the documentation.

Example 1

// a nested object
let obj = {
   foo: {
      baz: {
         pi: Math.PI
      }
   },
   bar: {
      bat: 'bathtub'
   }
}

// gives you the amount of values spreaded
// through the object
bob.size(obj).values // 2

// amount of keys, excluding 'this'
bob.size(obj).keys // 5

Example 2

// creating two vectors (read more in the DOCS)
let v1 = new bob.Vector2D(2, 5)
let v2 = new bob.Vector2D(6, 1)

// automatically 'upgrades' to 3D when applying the
// cross product on 2D vectors
v1.cross(v2) instanceof Vector3D // true

Example 3

// set up a deeply nested array
let something = [11, ['foo', 'bar', [12, 13], 'baz'], ['nice lib', 14]]

// log a nice tree to the console
bob.printArray(something)

/** output:
▧ 
├─ 11
├─▧ 
│ ├─ foo
│ ├─ bar
│ ├─▧ 
│ │ ├─ 12
│ │ └─ 13
│ └─ baz
└─▧ 
  ├─ nice lib
  └─ 14
**/

Example 4

// set angle unit to degrees
bob.angleMode('DEG')

// use trigonometric functions
bob.sin('30') // 0.5
bob.cos('45') // 0.7071...