{"id":16048919,"url":"https://github.com/devongovett/lzw-stream","last_synced_at":"2025-03-18T04:31:04.701Z","repository":{"id":23168887,"uuid":"26524761","full_name":"devongovett/lzw-stream","owner":"devongovett","description":"A streaming LZW encoder and decoder in JavaScript","archived":false,"fork":false,"pushed_at":"2020-12-24T06:19:53.000Z","size":2448,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-28T07:02:10.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devongovett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-12T07:41:05.000Z","updated_at":"2019-07-25T19:31:53.000Z","dependencies_parsed_at":"2022-08-21T19:50:15.366Z","dependency_job_id":null,"html_url":"https://github.com/devongovett/lzw-stream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Flzw-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Flzw-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Flzw-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Flzw-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devongovett","download_url":"https://codeload.github.com/devongovett/lzw-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902271,"owners_count":20366259,"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":[],"created_at":"2024-10-09T00:11:13.751Z","updated_at":"2025-03-18T04:31:03.915Z","avatar_url":"https://github.com/devongovett.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lzw-stream\n\nA streaming LZW encoder and decoder in JavaScript\n\n## Usage\n\nInstall using npm:\n\n    npm install lzw-stream\n\nPipe data to it:\n\n```javascript\nvar LZWDecoder = require('lzw-stream/decoder');\nvar LZWEncoder = require('lzw-stream/encoder');\nvar fs = require('fs');\n\nfs.createReadStream('in.txt')\n  .pipe(new LZWEncoder)\n  .pipe(new LZWDecoder)\n  .pipe(fs.createWriteStream('out.txt'));\n```\n\nThat example will produce a file `out.txt` that is identical to `in.txt`. Not very useful, \nbut it illustrates how to use both the encoder and decoder. Check out the Node \n[stream docs](http://nodejs.org/api/stream.html) for more info on streams.\n\n### dataSize\n\nThere is a `dataSize` option for both the encoder and decoder, passed in as an argument to\nthe constructor, which is the number of bits in each element of the input.  It is set to \n8 (or 1 byte) by default, since all elements in a buffer are 8 bits. If you knew you had\nASCII text, for example, you could set it to 7 since all ASCII characters can be represented\nin 7 bits.  This would lead to better compression. On the other hand, if your elements are \nlarger than 8 bits, then `dataSize` should be set to that size. Most of the time, however,\nyou should just use the default.\n\n## Browser Usage\n\nTo use lzw-stream in the browser, check out [Browserify](http://browserify.org), which \nbuilds Node-style modules for browser usage.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevongovett%2Flzw-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevongovett%2Flzw-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevongovett%2Flzw-stream/lists"}