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

@studiometa/js-toolkit

v3.4.3

Published

A set of useful little bits of JavaScript to boost your project! πŸš€

Readme

@studiometa/js-toolkit

NPM Version Downloads Size Dependency Status Codecov

A JavaScript data-attributes driven micro-framework shipped with plenty of useful utility functions to boost your project.

Installation

Install the latest version via NPM:

npm install @studiometa/js-toolkit

What is it?

This project is a JavaScript micro-framework (along with its utility functions) whose main objectives are:

  • Enforcing best-practice and consistency between projects
  • Using elements from the DOM easily
  • Enabling custom behaviours on component initialization or other user events
  • Disabling custom behaviours on component destruction or other user events
  • Initializing components in the right place at the right time
  • Defining dependencies between components

Visit js-toolkit.studiometa.dev to learn more, jump directly to ui.studiometa.dev to discover existing components, or open the playground to test it live.

Quick overview

This framework lets you define components as classes, and bind them to the DOM with data-… attributes. For example, here is how a Counter component would be defined in JavaScript:

import { Base } from '@studiometa/js-toolkit';

export default class Counter extends Base {
  static config = {
    name: 'Counter',
    refs: ['add', 'remove', 'count'],
  };

  get counter() {
    return this.$refs.count.valueAsNumber;
  }

  set counter(value) {
    this.$refs.count.value = value;
  }

  onAddClick() {
    this.counter += 1;
  }

  onRemoveClick() {
    this.counter -= 1;
  }
}

And its accompanying HTML would be sprinkled with data-… attributes to bind elements from the DOM to the JavaScript class.

<div data-component="Counter">
  <button data-ref="add">Add</button>
  <button data-ref="remove">Remove</button>
  <input data-ref="count" type="number" value="0" />
</div>

You can define options that can be specified with data-option-... attributes as well. First in JavaScript:

  class Counter extends Base {
    static config = {
      name: 'Counter',
      refs: ['add', 'remove', 'count'],
+     options: {
+       step: {
+         type: Number,
+         default: 1,
+       },
+     },
    };

    onAddClick() {
-     this.counter += 1;
+     this.counter += this.$options.step;
    }

    onRemoveClick() {
-     this.counter -= 1;
+     this.counter -= this.$options.step;
    }
  }

And then adjust it as you wish in your HTML:

- <div data-component="Counter">
+ <div data-component="Counter" data-option-step="2">
    <button data-ref="add">Add</button>
    <button data-ref="remove">Remove</button>
    <input data-ref="count" type="number" value="0">
  </div>

Like Web Components, components based on the Base class can be registered. Any matching component found in the DOM from the moment it is registered to any future change will be mounted.

import { registerComponent } from '@studiometa/js-toolkit';
import Counter from './components/Counter.js';

registerComponent(Counter);

Visit our "Getting Started" guide to learn more and try the above component by visiting the playground. Discover our existing library of components by checking out the @studiometa/ui package.

Contributing

This projects follows the Git Flow methodology to manage its branches and features. The packages and their dependencies are managed with NPM workspaces. The files are linted with ESLint, type checked with TypeScript and formatted with Prettier.

License

See LICENSE.