Do not zip. Just store. https://conduitry.dev/do-not-zip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Go to file
Conduitry 0bdfba0b4e
v1.0.0
4 years ago
src add .toAuto to replicate previous behavior 4 years ago
test fix and update tests 4 years ago
.eslintrc.yaml docs and stuff 5 years ago
.gitignore Adding tests for browser and node 5 years ago
CHANGELOG.md v1.0.0 4 years ago
LICENSE docs and stuff 5 years ago
README.md add .toAuto to replicate previous behavior 4 years ago
package.json v1.0.0 4 years ago
rollup.config.js switch to separate explicit functions for different kinds of output 4 years ago
rollup.config.test.js Adding tests for browser and node 5 years ago

README.md

do-not-zip

npm version

Do not zip. Just store.

What

Stick some text files into a zip file. This library is super simple and small because it just stores the files without compressing them, which is often sufficient when all you want to do is let the user download some files generated in the browser. Works on the server (Node.js) and on the client (JavaScript). Requires ES2015+.

How

import * as doNotZip from 'do-not-zip';
const output = doNotZip.toArray([
	{ path: 'path/to/file1.txt', data: 'Hello' },
	{ path: 'another/file2.txt', data: 'World' },
	{ path: 'yet/another/file3.bin', data: [1, 2, 3, 4, 5] },
]);
// => output will be an array of bytes
// use .toBuffer on the server to generate a Buffer, and use .toBlob on the client to generate a Blob
// use .toAuto to generate a Buffer on the server or a Blob on the client

Thanks

License

Copyright (c) 2018 Conduitry