{"id":28346688,"url":"https://github.com/systemvll/valve-lzss","last_synced_at":"2026-02-16T14:04:53.664Z","repository":{"id":274113392,"uuid":"921954014","full_name":"SystemVll/valve-lzss","owner":"SystemVll","description":"Valve's LZSS npm module implementation","archived":false,"fork":false,"pushed_at":"2025-03-01T15:19:28.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T05:13:07.759Z","etag":null,"topics":["codec","compression","game-networking","valve"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/valve-lzss","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SystemVll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-25T00:03:49.000Z","updated_at":"2025-03-01T15:19:31.000Z","dependencies_parsed_at":"2025-03-01T15:16:18.337Z","dependency_job_id":"9caba2af-ed06-4c1f-a0d5-8fca27b57593","html_url":"https://github.com/SystemVll/valve-lzss","commit_stats":null,"previous_names":["inplex-sys/lzss","inplex-sys/valve-lzss","systemvll/valve-lzss"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SystemVll/valve-lzss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fvalve-lzss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fvalve-lzss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fvalve-lzss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fvalve-lzss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SystemVll","download_url":"https://codeload.github.com/SystemVll/valve-lzss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fvalve-lzss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261211570,"owners_count":23125537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codec","compression","game-networking","valve"],"created_at":"2025-05-27T14:10:38.127Z","updated_at":"2026-02-16T14:04:53.658Z","avatar_url":"https://github.com/SystemVll.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LZSS Compression Library\n\nA TypeScript implementation of the LZSS (Lempel-Ziv-Storer-Szymanski) compression algorithm. LZSS is a lossless data compression algorithm that improves upon the LZ77 algorithm by not encoding matches if encoding would produce more output than leaving the data unencoded.\n\n## Features\n\n-   Fast compression and decompression\n-   Works with any binary data via `Uint8Array`\n-   Zero dependencies\n-   Written in TypeScript\n-   Full test coverage\n\n## Installation\n\n```bash\nbun install valve-lzss\n```\n\n## Usage Examples\n\n### Basic Compression\n\n```typescript\nimport LZSS from \"valve-lzss\";\n\nconst lzss = new LZSS();\n\n// Create some sample data\nconst data = new Uint8Array([1, 2, 3, 4, 5, 5, 5, 5, 5]);\n\n// Compress the data\nconst compressed = lzss.compress(data);\n\n// Decompress back\nconst decompressed = lzss.decompress(compressed);\n\nconsole.log(\"Original size:\", data.length);\nconsole.log(\"Compressed size:\", compressed.length);\nconsole.log(\n\t\"Decompressed matches original:\",\n\tdecompressed.every((byte, i) =\u003e byte === data[i])\n);\n```\n\n### Compressing Files\n\n```typescript\nimport LZSS from \"valve-lzss\";\nimport { readFileSync, writeFileSync } from \"fs\";\n\nconst lzss = new LZSS();\n\n// Read a file\nconst fileData = readFileSync(\"example.txt\");\nconst inputData = new Uint8Array(fileData);\n\n// Compress\nconst compressed = lzss.compress(inputData);\n\n// Save compressed data\nwriteFileSync(\"example.txt.lzss\", compressed);\n\n// Later decompress\nconst compressedFile = readFileSync(\"example.txt.lzss\");\nconst decompressed = lzss.decompress(new Uint8Array(compressedFile));\nwriteFileSync(\"example.decompressed.txt\", decompressed);\n```\n\n### Compression Parameters\n\nThe LZSS implementation uses these default parameters which can be referenced (but not modified):\n\n```typescript\nconst lzss = new LZSS();\n\nconsole.log(lzss.WINDOW_SIZE); // 4096 bytes sliding window\nconsole.log(lzss.LOOKAHEAD_SIZE); // 18 bytes lookahead buffer\nconsole.log(lzss.MIN_MATCH); // 3 bytes minimum match length\n```\n\n## API Reference\n\n###\n\nLZSS\n\nClass\n\n#### Constructor\n\n-\n\nnew LZSS()\n\n: Creates a new LZSS compressor instance\n\n#### Methods\n\n-\n\ncompress(input: Uint8Array): Uint8Array\n\n-   Compresses the input data\n-   Returns compressed data as Uint8Array\n\n-\n\ndecompress(input: Uint8Array): Uint8Array\n\n-   Decompresses previously compressed data\n-   Returns original data as Uint8Array\n\n#### Properties\n\n-\n\nreadonly WINDOW_SIZE\n\n: Size of the sliding window (4096)\n\n-\n\nreadonly LOOKAHEAD_SIZE\n\n: Size of lookahead buffer (18)\n\n-\n\nreadonly MIN_MATCH\n\n: Minimum match length (3)\n\n## Testing\n\nThe library includes comprehensive tests. To run them:\n\n```bash\nbun test\n```\n\n## Performance Considerations\n\n-   The compression ratio depends heavily on the input data's redundancy\n-   Best compression is achieved with repetitive data\n-   The sliding window size of 4096 bytes limits the distance for back-references\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests.\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a new Pull Request\n\n## Acknowledgements\n\nThis project was created using `bun init` in bun v1.2. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemvll%2Fvalve-lzss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemvll%2Fvalve-lzss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemvll%2Fvalve-lzss/lists"}