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

searilie

v1.2.2

Published

[![Greenkeeper badge](https://badges.greenkeeper.io/fossapps/searilie.svg)](https://greenkeeper.io/) [![Build Status](https://travis-ci.com/fossapps/searilie.svg)](https://travis-ci.com/fossapps/searilie) [![GitHub issues](https://img.shields.io/github/is

Readme

Searilie

Greenkeeper badge Build Status GitHub issues codecov devDependencies Status dependencies Status bundle size

This library tries to encode data to a very small payload, useful when you want to add data to url query parameters

Limitations

  • It can only store array of objects
  • each object on array must have same keys (name and number of keys)
  • it can only serialize string and number values nothing else
  • while decoding we need to pass a spec for our object

Example:

import {Searilie} from "./src/Searilie"
import {TinyCompressor} from "./src/adapters/TinyCompressor"
const serialization = new Searilie(new TinyCompressor()); // or use CSVCompressor
console.log(serialization.encode([{a: "k", b: 5}, {a: "c", b: 9}])); // Ak5c9

Tiny compressor:

can only compress 1 character values, but produces tiny payloads,

Tiny Number Compressor

This compressor only numbers by serializing into base 36 values saving some space, But in order to serialize and deserialize, it requires to know the number of spaces to allocate in advance.

Tiny number compressor accepts a key to char length factory, which is to provide number of spaces to allocate for a given key,

For our example, let's say our object looks like this: {a: 100, b: 1, c: 2} and we know for a fact that b and c won't go above the value 35, then we can use the following

import {Searilie, ValueType} from "./src/Searilie"; 
import {TinyNumberCompressor} from "./src/adapters/TinyNumberCompressor"
const tinyNumberCompressor = new TinyNumberCompressor((key) => key === "a" ? 2 : 1);
const searlie = new Searilie(tinyNumberCompressor);
searlie.encode([{a: 100, b: 25, c: 9}]); // C2sp9
searlie.decode("C2sp9", {a: ValueType.Number, b: ValueType.Number, c: ValueType.Number}); // [{a: 100, b: 25, c: 9}]

Choosing correct space values:

Number of spaces are determined by ((36 ^ N) - 1) (36 ** n) - 1 where N is number of spaces, for a quick references here are first 5 values:

  • n = 1 gets you from 0 - 35
  • n = 2 gets you from 0 - 1295
  • n = 3 gets you from 0 - 46655
  • n = 4 gets you from 0 - 1679615
  • n = 5 gets you from 0 - 60466175

CSVCompressor

separates data using , and ; producing larger payloads, but it can support more than 1 character payloads:

import {Searilie} from "./src/Searilie"
import {CSVCompressor} from "./src/adapters/CSVCompressor"; 
const serialization = new Searilie(new CSVCompressor());
console.log(serialization.encode([{a: "kick", b: 51}, {a: "cat", b: 92}])); // Bkick,51;cat,92

Deserialization

the first character on encoded payload denotes which compressor was used, we need to use the same compressor to ensure we don't load everything at once, we don't import everything and check it for you.

import {Searilie, ValueType} from "./src/Searilie"
import {CSVCompressor} from "./src/adapters/CSVCompressor"; 
const serialization = new Searilie(new CSVCompressor());
console.log(serialization.decode("Bkick,51;cat,92", {a: ValueType.String, b: ValueType.Number})); // [{a: "kick", b: 51}, {a: "cat", b: 92}]
console.log(serialization.decode("Bkick,51;cat,92", {myKey: ValueType.String, newKey: ValueType.Number})); // [{myKey: "kick", newKey: 51}, {myKey: "cat", newKey: 92}]

With headers

by trading off some character spaces, we can also encode data with keys so we don't need to provide schema while decoding

import {Searilie} from "./src/Searilie"
import {CSVCompressor} from "./src/adapters/CSVCompressor"; 
const serialization = new Searilie(new CSVCompressor());
console.log(serialization.encodeWithHeaders([{a: "kick", b: 51}, {a: "cat", b: 92}])); // Ba,|b:kick,51;cat,92
console.log(serialization.decodeUsingHeaders("Ba,|b:kick,51;cat,92")); // [{a: "kick", b: 51}, {a: "cat", b: 92}]