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

@sidereus/cube-compress

v0.1.2

Published

Compress .cube to .cubexs and decompress .cubexs to .cube files (Python + TypeScript)

Readme

@sidereus/cube-compress

A small Python module for compressing and decompressing .cube files. This repo also includes a frontend TypeScript version with the same format.

Install

npm install @sidereus/cube-compress

(前端用到的 fflate 会随包自动安装。)

Usage (Python)

from cube_compress import compress, decompress

compress("input.cube", "output.cubexs")
decompress("output.cubexs", "output.cube")

Usage (前端 TypeScript)

import { compress, decompress } from './cubeCompress';

// 压缩:输入 cube 文件字符串,输出字节数组
const cubeString = '...'; // 完整 .cube 文件内容
const bytes: Uint8Array = compress(cubeString);

// 解压:输入字节数组(.cubexs 或 compress 的输出),输出 cube 文件字符串
const restored: string = decompress(bytes);
  • compress(cubeString: string): Uint8Array — 输入为 cube 文件字符串,输出为字节数组(与 Python 写出的 .cubexs 格式一致)。
  • decompress(bytes: Uint8Array): string — 输入为字节数组,输出为 cube 文件字符串。

依赖:fflate(gzip 压缩/解压,自带 TypeScript 类型)。

Notes

  • This is a Python script distributed via npm for convenience.
  • You need Python and NumPy available in your environment.
  • Compression is lossy (float32 -> 24-bit) and output formatting may differ from the original.
  • compress() always writes .cubexs and decompress() always writes .cube.