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

balthier

v0.0.13

Published

Named after a pirate of the skies, Balthier (Hijacker) is api service mocker and a json response builder. Its purpose is provide fake repsonses that are compliant with user created contracts.

Readme

Balthier (Codename Hijacker)

Named after a pirate of the skies, Balthier (Hijacker) is api service mocker and a json response builder. Its purpose is provide fake repsonses that are compliant with user created contracts.

This is meant to speed up the development of UI's in case a developer has an idea of how a certain api response will be structured and wants to develop request/response related UI interactions, but the backend has not completely implemented the route with the api response.

The best scenario for this would be a session of rapid prototyping or a sales demo.

TL;DR

An axios proxy service that mocks get and post requests based on user JSON contracts. It uses faker to generate fake data

Installation

yarn add balthier npm install balthier

Example

Create a GET request Contracts json file and store it in some folder, lets say fixtures, and add the required params:

|required_params|description| |---------------|----| |name|name of resource| |action|"post" / "get"| |route|path of route| |params|an object of your params with strict values. This can also be blank| |json|Object of key mapping to string representations of faker methods: https://github.com/marak/Faker.js/#api-methods|

// myExample.json
{
  "name": "myResource", //required
  "version": "1.0.0",
  "action": "get", //required
  "route": "/example_resource", //required
  "params": { //required
    "foo": "bar"
  },
  "json": { //required
    "study_uuid": "random.uuid", //calls a faker resource
    "active": "random.boolean",
    "settings": {
      "foo": "random.boolean",
      "bar": "random.boolean",
      "lotsOfFoos": {"__data_type__": "array", "data": {"foo": "name.firstName"}, "counts": 3}
      // arrays must be written in the strict format
    }
  }
}

Then call the Hijacker method from balthier with a config object that has a reference to the directory, fixtures, that holds all your json contracts

const axios = require('axios');
const Hijacker = require('balthier');
const path = require('path');

const config = {
  contractsDirectory: path.join(__dirname, '../contracts') //required
};

if (NODE_ENV === 'development') {
  Hijacker(axios, config);
}

axios.get('/example_resource', {foo: 'bar'}).then(res => {
  console.log(res);
  /* will return the following:
  {
    study_uuid: "aeafcf80-1c9f-4c7d-9007-ca2f3d989e73",
    active: true,
    settings: {
      foo: true,
      bar: false,
      lotsOfFoos: [{foo: 'sean'}, {foo: 'john'}, ...]
    }
  }
  */
});