{"id":32263486,"url":"https://github.com/polygonplanet/lzjs","last_synced_at":"2025-10-22T20:57:24.359Z","repository":{"id":23049971,"uuid":"26403115","full_name":"polygonplanet/lzjs","owner":"polygonplanet","description":"A JavaScript library for compressing and decompressing strings using an original algorithm based on the LZ algorithm.","archived":false,"fork":false,"pushed_at":"2023-12-24T14:25:13.000Z","size":223,"stargazers_count":27,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T20:57:05.176Z","etag":null,"topics":["compression","decompressed-data","javascript","lz-algorithm","lz77","lzss","string-compression"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/polygonplanet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2014-11-09T17:27:05.000Z","updated_at":"2025-04-17T04:39:23.000Z","dependencies_parsed_at":"2024-06-18T18:31:22.084Z","dependency_job_id":"3c1ab67e-bc04-45fc-82ed-ef3063912cb6","html_url":"https://github.com/polygonplanet/lzjs","commit_stats":{"total_commits":54,"total_committers":1,"mean_commits":54.0,"dds":0.0,"last_synced_commit":"bb80fc1b898553d75fa9cd12922b3d1a199991a4"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/polygonplanet/lzjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonplanet%2Flzjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonplanet%2Flzjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonplanet%2Flzjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonplanet%2Flzjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polygonplanet","download_url":"https://codeload.github.com/polygonplanet/lzjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonplanet%2Flzjs/sbom","scorecard":{"id":740493,"data":{"date":"2025-08-11","repo":{"name":"github.com/polygonplanet/lzjs","commit":"bb80fc1b898553d75fa9cd12922b3d1a199991a4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:4","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/polygonplanet/lzjs/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/polygonplanet/lzjs/ci.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T17:17:11.091Z","repository_id":23049971,"created_at":"2025-08-22T17:17:11.091Z","updated_at":"2025-08-22T17:17:11.091Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280511639,"owners_count":26343103,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["compression","decompressed-data","javascript","lz-algorithm","lz77","lzss","string-compression"],"created_at":"2025-10-22T20:57:18.782Z","updated_at":"2025-10-22T20:57:24.355Z","avatar_url":"https://github.com/polygonplanet.png","language":"JavaScript","readme":"lzjs\n========\n\n[![GitHub Actions Build Status](https://github.com/polygonplanet/lzjs/actions/workflows/ci.yml/badge.svg)](https://github.com/polygonplanet/lzjs/actions)\n\nlzjs is a JavaScript library that compresses and decompresses strings using an original algorithm based on the LZ algorithm.\n\nThis can be particularly useful when storing large amounts of data in storage with size limitations, such as localStorage or cookies.\n\n## Installation\n\n### npm\n\n```bash\n$ npm install --save lzjs\n```\n\n#### using `import`\n\n```javascript\nimport lzjs from 'lzjs';\n```\n\n#### using `require`\n\n```javascript\nconst lzjs = require('lzjs');\n```\n\n### browser (standalone)\n\nYou can install the library via npm or download it from the [release list](https://github.com/polygonplanet/lzjs/tags). Use the `lzjs.js` or `lzjs.min.js` files included in the package.  \n\\*Please note that if you use `git clone`, even the *master* branch may be under development.\n\n```html\n\u003cscript src=\"lzjs.js\"\u003e\u003c/script\u003e\n```\nor the minified `lzjs.min.js`:\n\n```html\n\u003cscript src=\"lzjs.min.js\"\u003e\u003c/script\u003e\n```\n\nWhen the script is loaded, the `lzjs` object is defined in the global scope (i.e., `window.lzjs`).\n\n## Demo\n\n* [lzjs compression demo](https://polygonplanet.github.io/lzjs/demo/)\n\n## API\n\n* [compress](#lzjscompressdata-options)\n* [decompress](#lzjsdecompressdata-options)\n* [compressToBase64](#lzjscompresstobase64data)\n* [decompressFromBase64](#lzjsdecompressfrombase64data)\n\n----\n\n### lzjs.compress(data, [options])\n\nCompresses data into a binary string.\n\n#### Arguments\n\n* **data** *(string)* : Input data\n* **[options]** *(object)* : Compression options\n  * **onData** *(function (data) {})* : Called when a data is chunked\n  * **onEnd** *(function () {})* : Called when process ends\n\n#### Returns\n\n*(string)* : Compressed data\n\n#### Example\n\nExample of compressing and decompressing a string.\n\n```javascript\nconst data = 'hello hello hello';\nconst compressed = lzjs.compress(data);\nconsole.log(compressed); // 'Whello \\x80\\x82\\x84\\x86\\x83'\n\nconst decompressed = lzjs.decompress(compressed);\nconsole.log(decompressed === data); // true\n```\n\nCompress data using `onData` and `onEnd` events.\n\n```javascript\nconst string = 'hello hello hello';\nconst compressed = [];\n\nlzjs.compress(string, {\n  onData: (data) =\u003e {\n    compressed.push(data);\n  },\n  onEnd: () =\u003e {\n    console.log(compressed.join('')); // 'Whello \\x80\\x82\\x84\\x86\\x83'\n  }\n});\n```\n\n----\n\n### lzjs.decompress(data, [options])\n\nDecompresses a string that has been compressed with [`lzjs.compress()`](#lzjscompressdata-options)\n\n#### Arguments\n\n* **data** *(string)* : Input data\n* **[options]** *(object)* : Decompression options\n  * **onData** *(function (data) {})* : Called when a data is chunked\n  * **onEnd** *(function () {})* : Called when process ends\n\n#### Returns\n\n*(string)* : Decompressed data\n\n#### Example\n\nExample of decompressing a string that has been compressed with [`lzjs.compress()`](#lzjscompressdata-options).\n\n```javascript\nconst decompressed = lzjs.decompress('Wabc\\x80\\x82\\x81\\x83\\x83');\nconsole.log(decompressed); // 'abcabcabcabcabc'\n```\n\nDecompress data using `onData` and `onEnd` events.\n\n```javascript\nconst compressed = 'Whello \\x80\\x82\\x84\\x86\\x83';\nconst decompressed = [];\n\nlzjs.decompress(compressed, {\n  onData: (data) =\u003e {\n    decompressed.push(data);\n  },\n  onEnd: () =\u003e {\n    console.log(decompressed.join('')); // 'hello hello hello'\n  }\n});\n```\n\n----\n\n### lzjs.compressToBase64(data)\n\nCompresses and encodes data into a Base64 string.\n\n#### Arguments\n\n* **data** *(string)* : Input data\n\n#### Returns\n\n*(string)* : Compressed and Base64 encoded string\n\n#### Example\n\n```javascript\nconst data = 'hello hello hello';\nconst compressed = lzjs.compressToBase64(data);\nconsole.log(compressed); // 'V2hlbGxvIMKAwoLChMKGwoM='\n```\n\n----\n\n### lzjs.decompressFromBase64(data)\n\nDecompresses a string that has been compressed with [`lzjs.compressToBase64()`](#lzjscompresstobase64data).\n\n#### Arguments\n\n* **data** *(string)* : Input data\n\n#### Returns\n\n*(string)* : Decompressed data\n\n#### Example\n\n```javascript\nconst decompressed = lzjs.decompressFromBase64('V2FiY8KAwoLCgcKDwoM=');\nconsole.log(decompressed); // 'abcabcabcabcabc'\n```\n\n## Command line usage\n\nAfter `npm install -g lzjs`\n\n#### Add file to archive\n\n```bash\nlzjs -a something.txt\n```\n\n#### Extract file\n\n```bash\nlzjs -x something.txt.lzjs\n```\n\n### All command line options\n\n```\n  -h, --help                 show Help\n  -v, --version              show Version\n  -a, --add \u003cfile_name\u003e      Add file to archive\n  -x, --extract \u003cfile_name\u003e  eXtract file\n```\n\nNote that command line compression is only valid for the UTF-8 encoded file.\n\n## Contributing\n\nWe welcome contributions from everyone.\nFor bug reports and feature requests, please [create an issue on GitHub](https://github.com/polygonplanet/lzjs/issues).\n\n### Pull Requests\n\nBefore submitting a pull request, please run `$ npm run test` to ensure there are no errors.\nWe only accept pull requests that pass all tests.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\nSee the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygonplanet%2Flzjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolygonplanet%2Flzjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygonplanet%2Flzjs/lists"}