Détail du package

base58-js

pur3miish338.3kMIT3.0.3

A light weight universal JavaScript base58 encoder / decoder.

base58, decode, encode, blockchain

readme

base58 logo

base58-js

NPM Package CI status License: MIT

A lightweight (~560 bytes) universal JavaScript Base58 encoder and decoder.


Installation

Install base58-js via npm:

npm install base58-js

Requirements

Supported environments:

Usage Examples

Convert Base58 to binary

import { base58_to_binary } from "base58-js";

const bin = base58_to_binary("6MRy");
console.log(bin);

Logged output will be Uint8Array(3) [15, 239, 64].

Convert binary to base58

import { binary_to_base58 } from "base58-js";

const str = binary_to_base58([15, 239, 64]);
console.log(str);

The logged output was Thequickbrownfoxjumpedoverthea1zydog.

Exports

Deep imports from the ECMAScript modules are exported via the package.json field exports:

TypeScript Support

This package includes type definitions via TypeScript JSDoc for excellent IntelliSense and type checking.

changelog

base58-js changelog

3.0.3

Patch

  • Fixed Corrected TypeScript declaration files (.d.ts) to export functions properly without importing .d.ts files directly.

  • Updated index.d.ts to re-export named functions from implementation .js files, ensuring compatibility with TypeScript's module resolution and eliminating errors like TS2846 and TS1362.

  • Changed Improved package.json exports and types fields to explicitly map .js files to their corresponding .d.ts typings for better editor support and module resolution.

  • Enhanced README with detailed usage examples, environment requirements, export info, TypeScript support, and a clear explanation of tree-shaking implications.

  • This fixes the issue described in #4.

3.0.2

  • Added support for both named exports and explicit .js paths for binary_to_base58 and base58_to_binary modules.
  • Consumers can now import modules either without the .js extension or with it directly:

Without .js:

import binaryToBase58 from "base58-js/binary_to_base58";

With .js:

import binaryToBase58 from "base58-js/binary_to_base58.js";

3.0.1

Patch

  • Changed testing suite to mocha/chai.
  • removed size-limit.
  • Depen updates

3.0.0

Major

  • TypeScript declaration files (.d.ts) have been added for all public modules.
  • Support for node >=14.0.0 & npm >=7.0.0.
  • Imports now favours dropping the file extension.
  • Refined exports Field: Simplified the module exports by removing the .mjs and .js extensions from the paths. Now, users can import modules without needing to specify the file extension.

2.0.1

Patch

  • paydevs registry

2.0.0

Major

  • Upgraded to ESM as CJS is superseded.

Minor

1.0.5

Patch

  • Fixes #3

1.0.4

Patch

  • Changelog fixes.

Patch

  • Deprecation warning not actually fixed... again 😅.

Patch

  • Changelog updates.

1.0.2

Patch

  • Changelog updates.

1.0.1

  • Fixes #2.
  • Dev dependency updates.

1.0.0

Patch

  • package.json files removed static from white list.
  • Updated readme to reflects base58-js instead of base58.
  • Updated description.
  • size-limit fix, using @size-limit/preset-small-lib.

1.0.0-rc

Initial Release.