JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q62778F
  • License AGPL-3.0-only

Package Exports

  • low-level
  • low-level/dist/cjs/index.js
  • low-level/dist/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (low-level) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

low-level

Low-Level-JS is a lightweight and efficient library designed for working with binary data, fixed-size integers, and memory-optimized data structures in JavaScript and TypeScript. It provides a robust set of utilities for handling low level operations, including Uint-based arithmetic, binary maps, and structured data manipulation.

Usage

import { Uint8, Uint16, Uint32 } from 'low-level';

// Creating Uint instances
const uint8 = Uint8.from(255);
const uint16 = Uint16.from(65535);
const uint32 = Uint32.from(4294967295);

// Performing arithmetic operations
const sum = uint8.add(1); // Uint8 with value 0 (overflow)
const difference = uint16.sub(1); // Uint16 with value 65534

// Working with binary maps
import { UintMap } from 'low-level-js';

const map = new UintMap<string>();
map.set(uint8, "Value for Uint8");
map.set(uint16, "Value for Uint16");

console.log(map.get(uint8)); // Output: "Value for Uint8"
console.log(map.get(uint16)); // Output: "Value for Uint16"