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

lkstring

v1.1.2

Published

(Not lz-string) A simple string compress lib.

Downloads

3

Readme

lk-string

lk-string ~~一个盗版的lz-string~~一个小巧的字符串压缩库
用于对字符串数据进行压缩

使用

您可以通过(ClickMe)在线试用LKstring压缩
JavaScript示例

var lkstring = require( "./index" ),
  string = JSON.stringify({
    name: "love-kogasa",
    age: 14,
    description: "a baka tatarakogasa fans"
  }, 0, 4 ),
  code = lkstring.encode( string )
console.log( "源字符串: \t%s\n长度: %d", string, string.length )
console.log( "压缩后字符: \t%s\n长度: %d", code, code.length  )
console.log( "解压后字符: \t%s", lkstring.decode( code ))

原理

lk-string原理Very简单,定义一种规律性强字符数字编码
lk-string压缩步骤

  • 将字符串挨个转换为编码(编码为根据字符出现频率动态生成,字符编码等于字符集数组索引加字符集中字符的索引).
  • 编码过程中使用字符\x99分割每一段字符(字符分段以\x99为段首标识符)
  • 每段字符第一位为这一段字符所在的字符集数组索引,后续字符为对应字符的字符集中的索引
  • 每三个字符合并为一个字符,比如31, 32, 33合并为(0x99)3...123
  • 返回字符串