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

marshalling-binary-struct-js

v0.0.4

Published

Marshalling binary structures in JS

Readme

Marshalling-binary-struct-js

Allows projecting native structures onto structures of a typed array.

  • Status: pre alpha

Examples

const StructJS = require("marshalling-binary-struct-js");


const structJS = new StructJS();
structJS.add`
	typedef int32le i32;
	typedef struct {
		cstring_utf8 myString[256];
		i32 index;
		i32 flags;
		i32 flags2;
		struct {
			float32le x;
			float32le y;
			float32le z;
		} pos;
	} tmp_t;

	typedef tmp_t array_of_tmp_t[1024];
`;

const Marshalling = structJS.compile();
const ab = new ArrayBuffer(Marshalling.array_of_tmp_t._size);
const marshal = new Marshalling(ab);
const arrayTmp = new marshal.array_of_tmp_t(0);

arrayTmp._fill(0);

let i = 0;
for(const tmp of arrayTmp) {
	tmp.myString = `tmp string for ${i}`;
	tmp.index = i;
	tmp.flags |= 1;
	tmp.flags2 |= 0xF5890;
	tmp.pos.x = 2;
	tmp.pos.y = 2;
	tmp.pos.z = 2;
	i++;
}
console.log( arrayTmp.get(100).myString );
console.log( arrayTmp.get(100).index );

Base types

cstring_utf8[sizemax];

int8le int16le int32le int64le uint8le uint16le uint32le uint64le
int8be int16be int32be int64be uint8be uint16be uint32be uint64be

/// alias le 
int8 int16 int32 int64 uint8 uint16 uint32 uint64
int8 int16 int32 int64 uint8 uint16 uint32 uint64

/// alias int32le
int

Author: RainNeko