Installation

How to install and import @visulima/bytes

Last updated:

Installation

Install the package using your preferred package manager:

npm install @visulima/bytes
pnpm add @visulima/bytes
yarn add @visulima/bytes
bun add @visulima/bytes

Import Methods

Import specific functions you need:

import { concat, equals, toUint8Array } from "@visulima/bytes";

Import everything:

import * as bytes from "@visulima/bytes";

bytes.concat([...]);

CommonJS

For CommonJS environments:

const { concat, equals, toUint8Array } = require("@visulima/bytes");

Requirements

  • Node.js: ≥22.13 ≤25.x
  • TypeScript: ≥5.0 (optional, but recommended for type safety)

Verify Installation

Verify the package works correctly:

import { concat } from "@visulima/bytes";

const result = concat([
  new Uint8Array([1, 2]),
  new Uint8Array([3, 4])
]);

console.log(result); // Uint8Array([1, 2, 3, 4])

If you see the expected output, installation was successful!

TypeScript Support

The package includes full TypeScript type definitions. No additional @types packages are needed.

import type { Uint8ArrayList } from "@visulima/bytes";
import { concat } from "@visulima/bytes";

const arrays: Uint8Array[] = [
  new Uint8Array([1, 2]),
  new Uint8Array([3, 4])
];

const result: Uint8Array = concat(arrays);

Next Steps

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues