Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

README.md 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # ZipStream
  2. zip-stream is a streaming zip archive generator based on the `ZipArchiveOutputStream` prototype found in the [compress-commons](https://www.npmjs.org/package/compress-commons) project.
  3. It was originally created to be a successor to [zipstream](https://npmjs.org/package/zipstream).
  4. Visit the [API documentation](http://archiverjs.com/zip-stream) for a list of all methods available.
  5. ### Install
  6. ```bash
  7. npm install zip-stream --save
  8. ```
  9. You can also use `npm install https://github.com/archiverjs/node-zip-stream/archive/master.tar.gz` to test upcoming versions.
  10. ### Usage
  11. This module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called "callback hell".
  12. If you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally.
  13. ```js
  14. const Packer = require('zip-stream');
  15. const archive = new Packer(); // OR new Packer(options)
  16. archive.on('error', function(err) {
  17. throw err;
  18. });
  19. // pipe archive where you want it (ie fs, http, etc)
  20. // listen to the destination's end, close, or finish event
  21. archive.entry('string contents', { name: 'string.txt' }, function(err, entry) {
  22. if (err) throw err;
  23. archive.entry(null, { name: 'directory/' }, function(err, entry) {
  24. if (err) throw err;
  25. archive.finish();
  26. });
  27. });
  28. ```
  29. ## Credits
  30. Concept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated.