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

@doomfire/toolbox-javascript

v0.0.7

Published

A toolbox of structured javascript code that I use in my projects.

Readme

Toolbox Javascript

This is a toolbox of javascript code that I use in my projects. The main goal is having very structured code, classes and functions that is fast to find and easy to use correctly.

TODO:

helper function to grab the type of inputs. And nested type of input (if obj, list). And string, is it a string or a number?

MAYBE: also find if its just a regex string?

find(scope, target)

Why?

I find myself writing the same types or slightly different types from time to time. And when I do make components I don't remember where they are or how they work.

By having main classes that tells what it's about and then having static to further explain what it does I think it can be easier to find and then use what I need.

Example 1:

  • Class ObjectUtils
    • find(obj, target)

Now it's clear when I need something done with a Object I can go to ObjectUtils.

Now I need to find something and the static find makes it also clear.

target input is supposed to represent any type of target you would want. So far both a key and a object works.

The result is supposed to return everything it finds so you can pick what you want.

Possible improvements

I am still not sure what I will need in the future. The idea is that I will improve these whenever I need them.

Find
  • Have target values
    • Finding a key/object based on a value.
  • Use args like this: find(obj, ...target)
    • So you can pass in multiple targets.
    • To add support for more than one target.
Add more statics / functions
  • Remove - Remove a key/object from an object.
  • Add - Add a key/object to an object.
  • Create - Create a new object.

Update NPM package.

  • pnpm version patch
    • Update version number.
  • pnpm build
    • Build the package.
  • pnpm publish
    • Publish the package.

Testing:

  • pnpm pack
    • For creating local testing version.
  • cd to test project and do pnpm install ./doomfire-toolbox-javascript-0.0.2.tgz

Structure:

Current Idea

src/
├── core/                # Core utilities used internally
│   └── config.js        # Shared configuration (singleton pattern)
├── objects/             # Object-related utilities
│   ├── object-utils.js  # Object class
│   └── index.js         # Exports public methods
├── formatters/          # Formatting utilities
│   ├── number-formatter.js
│   ├── date-formatter.js
│   └── index.js
├── converters/          # Unit conversion
│   ├── time-converter.js
│   └── area-converter.js
├── data/                # Data processing
│   ├── data-reader.js   # Fetch/read data
│   ├── data-cleaner.js
│   └── data-finder.js
├── dom/                 # DOM manipulation
│   ├── dom-selector.js  # Get elements
│   ├── dom-editor.js    # Modify elements
│   └── event-listeners.js
└── index.js             # Main entry point (exports all public APIs)

TODO:

  • Make a proper readme file.

    • Add descriptions of each function.
    • Add examples.
  • Minify code? Tree shaking?

Folders:

  • dist/ - Built/compiled code for npm?
  • package.json - npm package file.
  • src/ - Source code. (Needed for javascript)

Classes

I probably gonna want a main config.js incase I have things I wanna reuse within this project. To save data/variables.

I also likely gonna using classes within classes for certain things. But hopefully as little classes as possible are exported to be used by other projects.

All classes need to require as little inputs as possible that will understand what function is desired. For example if I need a file name in I don't need to type in json but it will just get the file extension. And it should return most stuff so its easy to get what you need.

  • Objects - I currently have static find(obj, target) that in a obj targeting key/obj return list the path + value + object. I want to add more to it like add to object, remove from object, create object, etc

  • Formatters - To make things look pretty. EXAMPLE: number, date, currency, percent, years/time

  • Converters - Convert from one unit to all others. EXAMPLE: time, area,

  • Data Reader - read/fetch data from a file. Cleaner - clean data. Remove/replace/add/etc. Finder - find data in a file.

  • Elements/dom EXAMPLE: Target/Select: Get one, a selection of a few, or all elements using something like a class, id, etc. Get: data/value/etc Edit: data/value/etc Add: data/value/etc to a element. Create: create dynamic elements, or tables/charts.

  • Listeners - for each type of eventlistners etc.