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

node-mtmr

v2.1.0

Published

This is a Node library which wraps around [MTMR](https://github.com/Toxblh/MTMR). It is highly recommended to use this library with typescript. The main features are:

Readme

Node MTMR

This is a Node library which wraps around MTMR. It is highly recommended to use this library with typescript. The main features are:

  1. TS/JS support for button handlers
  2. Typescript typings for the items

For further documentation have a look at the original repo.

Installation

Here you find the NPM Page.

npm i node-mtmr

Or

yarn add node-mtmr

Setup

A working example can be found here.

Initialize parse

Create an index file inside your "src" directory. In this file call the "createParse" function:

import { createParse } from "node-mtmr";

const parse = createParse({
  outDir: "./my-mtmr-config",
  loggingEnabled: true,
});
  1. "outDir" is the output path for the script and assets. It's either relative to the cwd or absolute
  2. "loggingEnabled" configures the logging output

Execute parse

Pass the items to the parse function. The result is a correct MTMR item array.

const result = await parse(items);

Save result

There is a utility function for saving the output into the MTMR directory. Pass an options object with the force set to true to overwrite an existing file.

import { saveItems } from "node-mtmr";

saveItems(result, { force: true });

Utilities

If you want to create a ScriptTitledButton with a jsSource you can use either the createSourceScriptSync or the createSourceScript function. These will handle your script result and hand them to MTMR.

createSourceScriptSync(() => {
  const buttonLabel = "Label";
  const imageIdentifier = "inactive";

  return {
    label: buttonLabel,
    imgKey: imageIdentifier,
  };
});

or async

createSourceScript(async () => {
  const label = await func();
  return label;
});

or pass the result to the sourceOutput util function

sourceOutput({
  label: "Label",
  imgKey: "key",
});

If you your button needs a state make use of the state functions. Internally the data is stored in your computers ''/tmp/'' folder (so it might be deleted at some point):

const stateId = "counter";

const count = stateValue<number>(stateId, 0);
const setCount = stateFunction<number>(stateId);
const [count, setCount] = state<number>(stateId);

JavaScriptTitledButton

This is the new item type which supports JavaScript.

{
  type: "scriptTitledButton",
  sourceType: "javaScript",
  jsSource: {
    inline: () => {
      // Your function logic
    },
  },
  actions: [
    {
      action: "javaScript",
      trigger: "singleTap",
      actionJavaScript: {
        filePath: "./path/to/js/file.js",
      },
    },
  ],
}