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

rp-compress

v0.0.1

Published

Recursive pair compression

Downloads

7

Readme

status

Information

Usage

rp = require 'rp-compress'

test = "heyo"
enc = rp.compress test
dec = rp.decompress enc

How it works

rp-compress can acheive 45-50% compression with standard ASCII text

  1. Find the two-char bigram that appears most frequently in the source

  2. Replace the bigram with a currently-unused byte value and store it in a reference

  3. Repeat until there are no more unique bigrams (or the reference becomes full)

Examples

Repeating

Input (396 chars)

testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest

Output (37 chars)

'\u0000\u000b\n\u0004\n\t\b\t\b\b\b\u0007\u0007\u0007\u0006\u0006\u0006\u0005\u0005\u0005\u0004\u0004\u0004\u0003\u0003\u0003\u0002t\u0002\u0001s\u0001te\u0000\u000b\u0003'

Lyrics

Input (1870 chars)

We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

We've known each other for so long
Your heart's been aching but
You're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it
And if you ask me how I'm feeling
Don't tell me you're too blind to see

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

(Ooh, give you up)
(Ooh, give you up)
(Ooh)
Never gonna give, never gonna give
(Give you up)
(Ooh)
Never gonna give, never gonna give
(Give you up)

We've know each other for so long
Your heart's been aching but
You're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it

I just wanna tell you how I'm feeling
Gotta make you understand

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Output (813 chars)

þaýüûü#ûúùú¥ùø÷øGo÷öõöttõôóô,óòñòuñðïðœïaîíìíeìë'vêéè鎑èçæç§zæåäåoäãâ㚝âáàáàßÞߏhÞÝÜݎrÜÛÚۓ$ÚÙØّ&Ø×Ö× bÖÕÔÕutÔÓÒӁ˜ÒÑÐÑshÐÏÎÏy ÎÍÌ͊(ÌËÊ˒‰ÊÉÈÉnsÈÇÆÇidÆÅÄwÄÃÂbÂÁÀÁoÀ¿¾¿ ‚¾½¼½Ÿ“¼»º»nº¹¸¹—n¸·¶·¶µ´µ™e´³²³a²±°±m)°¯®¯we®­¬­ƒe¬«ª«ª©¨©pl¨’§€ ¦¥¤›¤£ž£¢z¢¡¡h" Ÿw•želoœst›&
šs™‚˜ˆ–—&€–t”•ha”o“‹…’ „‘ch
Wr ŽeaŒmŒI'‹‡bŠt‰
Iˆ‡†%†t'…ee„itƒ'r‚/"{€ oZ~~L}}q||x{
Yz fxgq`#g0_`^_)]^\X]h[\JF[urZ
NXVVTUUSTRCS>QRPdQ<OP-@O:MNaM8KLiKHJvH,EFupEcBCnBr?@?y=>.$=;<r;(9:6497827o565d34de3b12s1ye0li/kn.ru-le,++*k*ma(s&i%s $a#!" !tn l aythgel nd
vy  Ne nna oerou gWeˆnœra%Šve .-%šdI
Azulcomm„men‡Ÿ ink—f wldn'tei%from any§uy‰ juswþý
î/ê
Aif ask ¥Don'#m
                 ˜b0Šs…¦
î‚ê
‰ juswþý¦

LICENSE

(MIT License)

Copyright (c) 2012 Fractal [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.