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

@aurabx/jolt-js

v0.2.0

Published

JSON to JSON transformation library using the JOLT spec - TypeScript port of harmony-jolt

Readme

jolt-js

JSON to JSON transformation library using the JOLT spec.

TypeScript port of harmony-jolt, which itself is a port of the Java Jolt library.

Installation

npm install jolt-js

Usage

import { transform, TransformSpec } from 'jolt-js';

const input = {
  id: 1,
  name: "John Smith",
  account: {
    id: 1000,
    type: "Checking"
  }
};

const spec: TransformSpec = [
  {
    operation: "shift",
    spec: {
      name: "data.name",
      account: "data.account"
    }
  }
];

const output = transform(input, spec);
// {
//   data: {
//     name: "John Smith",
//     account: { id: 1000, type: "Checking" }
//   }
// }

Supported Operations

1. shift

Copy data from the input tree and put it in the output tree.

{
  operation: "shift",
  spec: {
    "name": "data.name",
    "*": "data.&"  // Wildcard matching
  }
}

Wildcards

  • * - match everything
  • name1|name2|nameN - match any of the specified names

Special Characters

  • & - reference matched key from path (&(x,y) for specific level/match)
  • $ - reference key value
  • @ - reference data value at path
  • [] - array index notation

2. default

Apply default values if not present in the input.

{
  operation: "default",
  spec: {
    "phones": {
      "code": "+1"
    }
  }
}

3. remove

Remove data from the tree.

{
  operation: "remove",
  spec: {
    "phones": {
      "country": ""
    }
  }
}

4. modify-overwrite-beta

Modify data using functions.

{
  operation: "modify-overwrite-beta",
  spec: {
    "fullName": "=concat(@(1,firstName),' ',@(1,lastName))"
  }
}

Supported Functions

  • concat - Concatenate multiple strings
  • toLower - Convert string to lowercase
  • toUpper - Convert string to uppercase
  • substring - Extract substring (start, end)
  • trim - Remove leading/trailing whitespace
  • join - Join array elements with separator

Modifier Variants

  • modify-overwrite-beta - Always writes the result
  • modify-default-beta - Only writes if key doesn't exist
  • modify-define-beta - Only writes if key doesn't exist or is null

License

Apache-2.0