Skip to content

Commit

Permalink
esm
Browse files Browse the repository at this point in the history
  • Loading branch information
ctalkington committed Oct 15, 2024
1 parent 4709099 commit 864b666
Show file tree
Hide file tree
Showing 8 changed files with 505 additions and 1,896 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
node-version: [14.x, 16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4.2.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.4
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: |
npm ci
npm test
env:
CI: true
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: tmp-zip-node-v${{ matrix.node-version }}
path: tmp/*.zip
- uses: actions/checkout@v4.2.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.4
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: |
npm ci
npm test
env:
CI: true
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: tmp-zip-node-v${{ matrix.node-version }}
path: tmp/*.zip
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#### Code Style Guide

* code should be indented with 2 spaces
* single quotes should be used where feasible
* commas should be followed by a single space (function params, etc)
* variable declaration should include `var`, [no multiple declarations](http://benalman.com/news/2012/05/multiple-var-statements-javascript/)
- code should be indented with 2 spaces
- single quotes should be used where feasible
- commas should be followed by a single space (function params, etc)
- variable declaration should include `var`, [no multiple declarations](http://benalman.com/news/2012/05/multiple-var-statements-javascript/)

#### Tests

* tests should be added to the nodeunit configs in `test/`
* tests can be run with `npm test`
* see existing tests for guidance
- tests should be added to the nodeunit configs in `test/`
- tests can be run with `npm test`
- see existing tests for guidance
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ This module is meant to be wrapped internally by other modules and therefore lac
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.

```js
const Packer = require('zip-stream');
const Packer = require("zip-stream");
const archive = new Packer(); // OR new Packer(options)

archive.on('error', function(err) {
archive.on("error", function (err) {
throw err;
});

// pipe archive where you want it (ie fs, http, etc)
// listen to the destination's end, close, or finish event

archive.entry('string contents', { name: 'string.txt' }, function(err, entry) {
archive.entry("string contents", { name: "string.txt" }, function (err, entry) {
if (err) throw err;
archive.entry(null, { name: 'directory/' }, function(err, entry) {
archive.entry(null, { name: "directory/" }, function (err, entry) {
if (err) throw err;
archive.finish();
});
Expand Down
Loading

0 comments on commit 864b666

Please sign in to comment.