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

meta-toolkit

v1.1.9

Published

Zero-dependency toolkit for meta programming and OOP: name-casing conversions, property descriptors, aliases, prototype traversal, iterators, deep path access, option merging, and comparator adapters

Readme

Meta toolkit NPM version

Meta toolkit is a no-dependency, no-nonsense collection of small utilities for meta programming and OOP that my projects accumulated over the years: generating classes, objects, prototypes, iterators, and more.

  • Name mangling (meta-toolkit/names.js) provides a conversion from compound names such as foo-bar to ['foo', 'bar'] and from ['foo', 'bar'] to fooBar and vice versa.
    • Used to generate file names, method names, and so on.
    • The following naming schemas are supported out of box:
      • camelCasetoCamelCase(), fromCamelCase().
      • PascalCasetoPascalCase(), fromPascalCase().
      • snake_casetoSnakeCase(), fromSnakeCase().
        • SNAKE_CASEtoAllCapsSnakeCase().
      • kebab-casetoKebabCase(), fromKebabCase().
  • Descriptor manipulation (meta-toolkit/descriptors.js) — generate accessors dynamically and share them between objects/prototypes:
    • Create descriptors — makeGetter(), makeSetter(), makeAccessors().
    • Add descriptors — addDescriptor(), addDescriptors(), addAccessor(), addGetters().
    • defaultDescriptor — the default descriptor template.
    • Copy descriptors — copyDescriptors().
  • Aliases (meta-toolkit/aliases.js) — alias existing properties:
    • Alias properties — addAlias(), addAliases().
  • Prototypes (meta-toolkit/prototypes.js) — inspect prototypes:
    • Iterate over prototypes — prototypes().
    • getPropertyDescriptor() — similar to getOwnPropertyDescriptor(), but for all prototypes not just the current object.
  • Iterators (meta-toolkit/iterators.js) — simplify creating custom iterators:
    • Augment iterable with an iterator interface — augmentIterator(), normalizeIterator().
    • Add array-like methods if not present — mapIterator(), filterIterator().
  • Path (meta-toolkit/path.js) — work with nested objects using paths:
    • Get a value from a nested object by path — get().
    • Set a value in a nested object by path — set(), forceSet().
    • Remove a value from a nested object by path — remove().
  • Options (meta-toolkit/options.js) — organize options for constructors:
    • Copy options according to some defaults — copyOptions().
  • Comparators (meta-toolkit/comparators.js) — convert between different comparator function styles:
    • Create a compare function from a less function and vice versa — compareFromLess(), lessFromCompare().
    • Create an equality function from a less function — equalFromLess().
    • Reverse comparators — reverseCompare(), reverseLess().

See the full documentation in the wiki.

Examples

Generating names:

import {
  toCamelCase,
  toPascalCase,
  toSnakeCase,
  toAllCapsSnakeCase,
  fromKebabCase
} from 'meta-toolkit/names.js';

const names = fromKebabCase('foo-bar-baz');

console.log(toCamelCase(names)); // fooBarBaz
console.log(toPascalCase(names)); // FooBarBaz
console.log(toSnakeCase(names)); // foo_bar_baz
console.log(toAllCapsSnakeCase(names)); // FOO_BAR_BAZ

Aliasing properties:

import {addAliases} from 'meta-toolkit/aliases.js';

class Foo {
  constructor() {
    this.value = 0;
  }
  get double() {
    return this.value * 2;
  }
  line(a, b) {
    return a * this.value + b;
  }
}
addAliases(Foo.prototype, {
  double: 'x2, duplicate',
  line: 'linear'
});

const f = new Foo();
f.value = 2;

console.log(f.double); // 4
console.log(f.x2); // 4
console.log(f.linear(1, 2)); // 4

Object manipulation with paths:

import {set, get, remove, forceSet} from 'meta-toolkit/path.js';

const object = {};

forceSet(object, 'a.b.c', 1); // object = {a: {b: {c: 1}}}

get(object, 'a.b.c'); // 1
get(object, 'a'); // {b: {c: 1}}

set(object, 'a.b.c', 2); // object = {a: {b: {c: 2}}}
forceSet(object, 'a.b.d', 3); // object = {a: {b: {c: 2, d: 3}}}

remove(object, 'a.b.c'); // object = {a: {b: {d: 3}}}
remove(object, 'a.b'); // object = {a: {}}

License

BSD 3-Clause "New" or "Revised" License. See the LICENSE file for details.

Release History

  • 1.1.9 Updated dev dependencies.
  • 1.1.8 Added TS typing tests, CJS test. Fixed .d.ts typings for strict mode. Improved docs and workflows. Updated dev dependencies.
  • 1.1.7 Added JSDoc to all source files. Fixed addGetters() bug with symbol keys. Improved docs. Added AI-friendly project files.
  • 1.1.6 Updated dev dependencies.
  • 1.1.5 Updated dev dependencies.
  • 1.1.4 Updated dev dependencies.
  • 1.1.3 Technical release: added types to package.json.
  • 1.1.2 Added TS types.
  • 1.1.1 Updated deps.
  • 1.1.0 Added comparator utilities.
  • 1.0.0 Initial release.