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

mud-parser

v0.2.5

Published

Unify JSON with schemas.

Readme

mud-parser

npm npm NPM

CAUTION: This package is currently experimental.


Mud parser can extract values from an API response and construct them into a predictable data type.

This is especially helpful for services that use more than one API source for a given service. Instead of writing different rules for each API, you can unify the responses.

Install

npm install mud-parser

or

yarn add mud-parser

Usage

Import

import { MudParser } from 'mud-parser';

checkMudSchema is also available.

Usage

const result = MudParser(schema, response.data);

Schema example:

{
    version: 1,
    url: 'https://some-api/some-endpoint?query=',
    parsers: [
      { key: "title", value: "data.movies.0.title" },
      { key: "imdbId", value: "data.movies.0.imdb_code" },
      { key: "realName", value: "data.movies.0.cast|castMembers.0.full_name" },
      { key: "characterName", value: "data.movies.0.cast|castMembers.0.character" },
    ],
}

Output:

[
  {
    title: '12 Angry Men',
    imdbId: 'tt0050083',
    castMembers: [
      {
        realName: 'Martin Balsam',
        characterName: 'Juror 1'
      },
      {
        realName: 'John Fiedler',
        characterName: 'Juror 2'
      },
      ...
    ]
  },
  {
    title: 'Limelight',
    imdbId: 'tt0044837',
    castMembers: [
      {
        realName: 'Charles Chaplin',
        characterName: 'Calvero'
      },
      {
        realName: 'Claire Bloom',
        characterName: 'Thereza 'Terry' Ambrose'
      },
      ...
    ]
  },
]

Syntax


An object can be acquired by:

firstName

Example:

{
  "firstName": "Some name"
}

An array can be aquired by adding a dot, followed by a number:

movies.0 movies array would be acquired

Example:

{
  "movies": ["12 Angry Men", "Limelight"]
}

0.movie If the response is list of objects, each object's movie property would be acquired.

Example:

[
  {
    "movie": "12 Angry Men"
  },
  {
    "movie": "Limelight"
  }
]

0.movies.0 Getting the array of objects inside an array.

Example:

[
  {
    "movies": ["12 Angry Men", "Limelight"]
  },
  {
    "movies": ["Seven Samurai", "City of God"]
  }
]

Limitations

The following limitations are planned to be fixed. Currently there is no way around them.

  1. Flat API responses cannot be parsed correctly.
{
  "abilities": [
    {
      "ability": {
        "name": "imposter"
      }
    },
    {
      "ability": {
        "name": "limber"
      }
    }
  ],
  "height": 3
}

Current result:

[
  {
    abilities: {
      ability: {
        name: "limber",
      },
    },
  },
  {
    abilities: {
      ability: {
        name: "imposter",
      },
    },
  },
  {
    height: 3,
  },
];
  1. Value conversion is not supported. Currently there is no way to convert values into different types, including string -> number. A more challanging change Object -> Array or vice versa is also an important part that is missing.