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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@swim/codec

v4.0.0

Published

Incremental I/O; functional parsers and writers; display, debug, and diagnostic formatters; and Unicode and binary codecs

Downloads

225

Readme

Swim Swim Codec Library

The Swim Codec library implements an incremental I/O engine, providing:

  • functional parsers and writers
  • display, debug, and diagnostic formatters
  • Unicode and binary codecs

Overview

Inputs and Outputs

An Input reader abstracts over a non-blocking token input stream, with single token lookahead. An Output writer abstracts over a non-blocking token output stream.

Parsers and Writers

A Parser incrementally reads from a sequence of Input chunks to produce a parsed result. A Writer incrementally writes to a sequence of Output chunks.

Binary codecs

The Binary factory has methods to create Input readers that read bytes out of byte buffers, and methods to create Output writers that write bytes into byte buffers.

Text codecs

The Unicode factory has methods to create Input readers that read Unicode code points out of strings, and methods to create Output writers that write Unicode code points into strings.

The Utf8 factory has methods to create Input readers that decode Unicode code points out of UTF-8 encoded byte buffers, and methods to create Output writers that encode Unicode code points into UTF-8 encoded byte buffers.

Binary formats

The Base10 factory has methods to create Parsers that incrementally parse decimal formatted integers, and methods to create Writers that incrementally write decimal formatted integers.

The Base16 factory has methods to create Parsers that incrementally decode hexadecimal encoded text input into byte buffers, and methods to create Writers that incrementally encode byte buffers to hexadecimal encoded text output.

The Base64 factory has methods to create Parsers that incrementally decode base-64 encoded text input into byte buffers, and methods to create Writers that incrementally encode byte buffers to base-64 encoded text output.

Formatters

The Display interface provides a standard way for implementing classes to directly output human readable display strings. Similarly, the Debug interface provides a standard way for implementing classes to directly output developer readable debug strings.

Format provides extension methods to output display and debug strings for all types, including builtin JavaScript types. OutputStyle provides helper functions to conditionally emit ASCII escape codes to stylize text for console output.

Diagnostics

A Tag abstracts over a source input location. A Mark describes a source input position, and a Span describes a source input range. A Diagnostic attaches an informational message to a source input location, and supports displaying the diagnostic as an annotated snippet of the relevant source input.