Skip to content

Commit 4c58eaf

Browse files
authored
esm (#233)
1 parent 4709099 commit 4c58eaf

10 files changed

Lines changed: 530 additions & 1922 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
node-version: [14.x, 16.x, 18.x, 20.x]
17+
node-version: [18.x, 20.x]
1818

1919
steps:
20-
- uses: actions/checkout@v4.2.1
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v4.0.4
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
- name: npm install and test
26-
run: |
27-
npm ci
28-
npm test
29-
env:
30-
CI: true
31-
- name: Archive production artifacts
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: tmp-zip-node-v${{ matrix.node-version }}
35-
path: tmp/*.zip
20+
- uses: actions/checkout@v4.2.1
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4.0.4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- name: npm install and test
26+
run: |
27+
npm ci
28+
npm test
29+
env:
30+
CI: true
31+
- name: Archive production artifacts
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: tmp-zip-node-v${{ matrix.node-version }}
35+
path: tmp/*.zip

.github/workflows/npmpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v4.2.1
1212
- uses: actions/setup-node@v4.0.4
1313
with:
14-
node-version: 16
14+
node-version: 20
1515
- run: npm ci
1616
- run: npm test
1717

@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4.2.1
2323
- uses: actions/setup-node@v4.0.4
2424
with:
25-
node-version: 16
25+
node-version: 20
2626
registry-url: https://registry.npmjs.org/
2727
- run: npm ci
2828
- run: npm publish

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Changelog
22

3+
**7.0.0** - <small>October 14, 2024</small> — [Diff](https://github.com/archiverjs/node-zip-stream/compare/6.0.1...7.0.0)
4+
35
**6.0.1** - <small>March 9, 2024</small> — [Diff](https://github.com/archiverjs/node-zip-stream/compare/6.0.0...6.0.1)
46

57
**6.0.0** - <small>February 27, 2024</small> — [Diff](https://github.com/archiverjs/node-zip-stream/compare/5.0.2...6.0.0)

CONTRIBUTING.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
#### Code Style Guide
44

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

107
#### Tests
118

12-
* tests should be added to the nodeunit configs in `test/`
13-
* tests can be run with `npm test`
14-
* see existing tests for guidance
9+
- tests should be added in `test/`
10+
- tests can be run with `npm test`
11+
- see existing tests for guidance

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ This module is meant to be wrapped internally by other modules and therefore lac
2121
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.
2222

2323
```js
24-
const Packer = require('zip-stream');
25-
const archive = new Packer(); // OR new Packer(options)
24+
import { ZipStream } from "zip-stream":
25+
const archive = new ZipStream(); // OR new ZipStream(options)
2626

27-
archive.on('error', function(err) {
27+
archive.on("error", function (err) {
2828
throw err;
2929
});
3030

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

34-
archive.entry('string contents', { name: 'string.txt' }, function(err, entry) {
34+
archive.entry("string contents", { name: "string.txt" }, function (err, entry) {
3535
if (err) throw err;
36-
archive.entry(null, { name: 'directory/' }, function(err, entry) {
36+
archive.entry(null, { name: "directory/" }, function (err, entry) {
3737
if (err) throw err;
3838
archive.finish();
3939
});

0 commit comments

Comments
 (0)