Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kagis/zipcat
Catenates multiple byte-streams into zip-stream
https://github.com/kagis/zipcat
create-zip create-zip-file zip zipjs
Last synced: about 1 month ago
JSON representation
Catenates multiple byte-streams into zip-stream
- Host: GitHub
- URL: https://github.com/kagis/zipcat
- Owner: kagis
- Created: 2022-06-24T08:06:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T08:42:57.000Z (over 2 years ago)
- Last Synced: 2024-11-01T00:04:20.882Z (about 2 months ago)
- Topics: create-zip, create-zip-file, zip, zipjs
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# zipcat
```js
import { zipcat } from 'https://raw.githubusercontent.com/kagis/zipcat/c2fc55f65f33c1576ae5cd9c6ed6e5999dc7f032/zipcat.js';
import { readableStreamFromIterable } from 'https://deno.land/[email protected]/streams/mod.ts';await readableStreamFromIterable(zipcat(generate_zip_entries())).pipeTo(Deno.stdout.writable);
async function * generate_zip_entries() {
yield { name: 'one.txt', data: utf8enc('hello world\n') };
yield { name: 'two.txt', data: [utf8enc('lorem ipsum\n'), utf8enc('dolor sit amet\n')] };
const file = await Deno.open('/tmp/three.txt');
yield { name: 'three.txt', data: file.readable };
}function utf8enc(s) {
return new TextEncoder().encode(s);
}
```