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

hrabi

v1.1.1

Published

<p align="center"> <img width="300" height="300" src="https://github.com/naftalimurgor/hrabi/blob/parse-abi-with-metadata/assets/logo.png"> </p>

Readme

hrabi

JSON to Human Readable ABI converter for Solidity JSON ABIs. A command-line tool that enables parsing JSON ABIs emitted during Smart Contract compilation to a Human Readable format, which is an Array with entries of the contract signatures.

Usage

Installation

Install as a global dependency which will later be usable as a commandline application.

npm i -g hrabi

Usage signature:

hrabi parse <path to json abi file> <output path>

To parse a JSON ABI to a Human Readable ABI format:

hrabi parse GameItem.json GameItem.js

Where:

  1. GameItem.json is the JSON ABI file path
  2. GameItem.js is the output path pointing to a file to store the Human Readable formatted ABI.

Currently supports parsing to fully Human Readable ABIs. The biggest advantage with Human Readable ABIs is:

  • Provides an array of strings of a contract's signature. Quite handy to use as ABI becomes a regular array that's compact and integrates well with JavaScript code or any other ideal codebase.

Example

A sample ERC1155 ABI in JSON format looks like this:

[
  {
    "inputs": [],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "approved",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "uint256",
        "name": "tokenId",
        "type": "uint256"
      }
    ],
    "name": "Approval",
    "type": "event"
  }
  // ...
  // other elements omitted for brevity
  
]

In Human Readable Format, the above ABI becomes:

const ERC1155 = [
  "constructor()",
  "event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)",
  "event ApprovalForAll(address indexed owner, address indexed operator, bool approved)",
  "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)",
  "function approve(address to, uint256 tokenId)",
  "function balanceOf(address owner) view returns (uint256)",
  "function create(address emotion, string mytokenURI) returns (uint256)",
  "function getApproved(uint256 tokenId) view returns (address)",
  "function isApprovedForAll(address owner, address operator) view returns (bool)",
  "function name() view returns (string)",
  "function ownerOf(uint256 tokenId) view returns (address)",
  "function safeTransferFrom(address from, address to, uint256 tokenId)",
  "function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data)",
  "function setApprovalForAll(address operator, bool approved)",
  "function supportsInterface(bytes4 interfaceId) view returns (bool)",
  "function symbol() view returns (string)",
  "function tokenURI(uint256 tokenId) view returns (string)",
  "function transferFrom(address from, address to, uint256 tokenId)"
]

Example in use

  <script>
    // possible lines of code omitted
    const GreeterAddress = '0x34eB49779a4475b0Cead7DBBB5A5807e89FaB569'
    const provider = new ethers.providers.Web3Provider(window.ethereum)

    document.getElementById('connectBtn').addEventListener('click', connect)
    async function connect() {
      await provider.send('eth_requestAccounts', [])
    }

    const signer = provider.getSigner()

    const GreeterAbi = [
      "function greet() public view returns (string memory)",
      "function setGreeting(string memory _greeting) public"
    ]
    
    const greeterContractInstance = new ethers.Contract(GreeterAddress, GreeterAbi, signer)

</script>

Or view the example

Contributing

All contributions are highly welcome, be sure to check out the contributing guidlines. Check out issues under the issues tab. Or open a new issue to help improve this library.

Development

Setting Up

To set up project locally for development:

git clone <your fork url>
cd <your fork path>
yarn install

To build the project:

yarn compile

Testing changes can take the the classic node <script.js> approach. To test changes, the following works fine:

node lib/index.js parse GameItem.json GameItem.js

To test installation locally:

yarn test-install
hrabi --version # check version info

Tests

To run unit tests:

yarn test

Support

Any form of support is highly appreciated: For any form of support, please send ETH to : 0x1Df4D4FA3d513De5d6a4E95a5DCcC8CBB02569B3

LICENSE

MIT