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

kasten-js

v0.5.0

Published

TypeScript toolbox for encoding, decoding, and compression algorithms

Readme

Kasten

TypeScript toolbox for encoding, decoding, and compression algorithms with no dependencies.

This library is currently in development.

The API can be changed in future release.

Goals

To provide several codec utility with no dependencies and simple API.

Features

Kasten provides several variant of encoding, decoding and compression functionalities for JavaScript.

  • Base 64 Encoding/Decoding
    • RFC2045
    • RFC4648
    • RFC4648 (URL)
  • Base 32 Encoding/Decoding
    • RFC4648
    • RFC4648 (Hex)
  • Base 16 Encoding/Decoding
    • RFC4648
    • AsciiHexDecode (PDF1.7)
  • Base 85
    • Ascii85Decode (PDF1.7)
  • Run-Length Encoding/Decoding
    • Basic
    • PackBits
    • RunLengthDecode (PDF1.7)

You can uses those features by very simple API. See also Usage section.

Following features are currently working in progress.

Other formats can be added in future.

  • Deflate
  • Zstd
  • Brotli

Usage

Create codec instance with static methods of Kasten.

import { Kasten } from 'kasten-js';

const data: Uint8Array = ...;

const base64 = Kasten.codecs.base64('rfc4648');

const encoded: string = base64.encode(data);

const decoded: Uint8Array = base64.decode(encoded);

const runLength = Kasten.compressors.runLength('pdf');

const compressed = runLength.compress(data);

const decompressed = runLength.decompress(compressed);

If no category specified, returns default implementation.

import { Kasten } from 'kasten-js';

const base16 = Kasten.codecs.base16();

You can get the codec implementations via Kasten.codecs property.

You cant get the compressor implementations via Kasten.compressors property.

All codecs available in Kasten are below.

|Group|Spec|Method|Category|Summary| |:-|:-|:-|:-|:-| |Base 64|RFC2045|Kasten.codecs.base64|rfc-2045|The old Base 64 specification.| |Base 64|RFC4648|Kasten.codecs.base64|rfc-4648|The latest Base 64 specification. It is compatible with Uint8Array.prototype.toBase64.| |Base 64|RFC4648(URL)|Kasten.codecs.base64|rfc-4648-url|The latest Base 64 specification for URL safe encoding. It is compatible with Uint8Array.prototype.toBase64.| |Base 32|RFC4648|Kasten.codecs.base32|rfc-4648|The latest Base 32 specification.| |Base 32|RFC4648 (HEX)|Kasten.codecs.base32|rfc-4648-hex|The latest Base 32 specification for hexadecimal encoding.| |Base 16|RFC4648|Kasten.codecs.base16|rfc-4648|The latest Base 16 specification.| |Base 16|AsciiHexDecode (PDF1.7)|Kasten.codecs.base16|ascii-hex|The Base 16 specification of PDF1.7.| |Base 85|Ascii85Decode (PDF1.7)|Kasten.codecs.base85|ascii-85|The Base85 specification of PDF1.7.| |Run-Length|Basic|Kasten.compressors.runLength|basic|The basic and old Run-Length encoding.| |Run-Length|PackBits|Kasten.compressors.runLength|pack-bits|The old Run-Length encoding accepted by MacPrint of Apple.| |Run-Length|RunLengthDecode (PDF1.7)|Kasten.compressors.runLength|pdf|The Run-Length specofication of PDF1.7.|

License

This project is licensed under the MIT License.