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

binarytojson

v2.0.7

Published

**Types of format**

Downloads

130

Readme

Types of format

export const formats = {
  string: 'string',
  stringNumber: 'stringNumber',
  number: 'number',
  float: 'float',
  bitFlag: 'bitFlag',
  array: 'array',
  spare: 'spare',
  flag: 'flag',
  packed: 'packed',
  packedNumber: 'packedNumber',
  date: 'date',
};

Description of each format

string: The hex data is directly converted into EBCDIC (string). If the hex data matches the pattern /\0.*$/g then an empty string ("") is populated

stringNumber: This format assumes that the hex data is a string which represents a number. It first converts the hex data to EBCDIC (string) and then uses the parseFloat function to convert the string into a float.

number: Directly converts the hex into decimal

float: Directly converts the hex into decimal and then divides by 100

bitFlag: This format is for a single byte of data. The single byte is converted into 8 bits, and then depending on the value of the bit, if its 1, the data is set to true and if its 0, the data is set to false.

array: This format is useful for array type of data. The normal layout fields work a bit differently in format array

  • numBytes: For array, numBytes field holds the size of a SINGLE ELEMENT. Suppose you have a array of size 10 and each array element is a character of size 1 byte. The value of numBytes in this case should be 1
  • numEntries: This is a special field only used in format array. This represents the number of elements in the array. Suppose you have a array of size 10 and each array element is a character of size 1 byte. The value of numEntries in this case should be 10
  • base: This is a special field only used in format array. This field holds the base location in the JSON where the array must reside.
  • arrayDetails: This is a special field only used in format array. arrayDetails holds a new Layout format which describes the layout of the array which is being mapped.

spare: Should only be used when you want to ignore the data. No location field needed in this format because the data isnt being inserted anyways

flag: If the hex data is e8 (Y) or a8 (y), then the data is set to true else false

packed: Only the last character is removed the from hex data. Reset everything is kept the same. Even the data itself stays in hex format

packedNumber: The last character is removed from the hex data. Then a decimal point in inserted at second last position. After this, the parseFloat method is ran.

date: This format is similar to packed, where in it removes the last character from the hex data. The remaining data is the parsed into the mainframe date format, ran throught Luxon's DateTime.local() function and only the date is returned using toISODate() function

binary: Not implemented yet