Skip to content

Commit

Permalink
esm (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctalkington authored Oct 15, 2024
1 parent 4709099 commit 4c58eaf
Show file tree
Hide file tree
Showing 10 changed files with 530 additions and 1,922 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
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/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
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
4 changes: 2 additions & 2 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm test

Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Changelog

**7.0.0** - <small>October 14, 2024</small> — [Diff](https://github.com/archiverjs/node-zip-stream/compare/6.0.1...7.0.0)

**6.0.1** - <small>March 9, 2024</small> — [Diff](https://github.com/archiverjs/node-zip-stream/compare/6.0.0...6.0.1)

**6.0.0** - <small>February 27, 2024</small> — [Diff](https://github.com/archiverjs/node-zip-stream/compare/5.0.2...6.0.0)
Expand Down
11 changes: 4 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

#### 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 ran through `prettier`

#### 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 in `test/`
- tests can be run with `npm test`
- see existing tests for guidance
10 changes: 5 additions & 5 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 archive = new Packer(); // OR new Packer(options)
import { ZipStream } from "zip-stream":
const archive = new ZipStream(); // OR new ZipStream(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 4c58eaf

Please sign in to comment.