Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: archiverjs/node-archiver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4ea661ec8a9d4cfc43f6c84bbeb63147156648e8
Choose a base ref
...
head repository: archiverjs/node-archiver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5d3f168ebcf25643cdff4749739fa6a947fda41a
Choose a head ref

Commits on Jul 5, 2017

  1. additional jsdoc.

    ctalkington committed Jul 5, 2017
    Copy the full SHA
    e872dfb View commit details

Commits on Jul 8, 2017

  1. fix CHANGELOG typo.

    ctalkington committed Jul 8, 2017
    Copy the full SHA
    9da60f7 View commit details

Commits on Aug 25, 2017

  1. Add const to the initial variable (#261)

    abetomo authored and ctalkington committed Aug 25, 2017
    Copy the full SHA
    92b9a25 View commit details
  2. Fix coding style (#263)

    https://github.com/archiverjs/node-archiver/blob/master/CONTRIBUTING.md
    
    * Fix to match coding style
    
    Additional modification of the part where fixes were missing
    abetomo authored and ctalkington committed Aug 25, 2017
    Copy the full SHA
    86a62ce View commit details

Commits on Aug 26, 2017

  1. bump version for release.

    ctalkington committed Aug 26, 2017
    Copy the full SHA
    53b521e View commit details
  2. fix changelog date ...

    ctalkington committed Aug 26, 2017
    Copy the full SHA
    fb7c7f6 View commit details
  3. bump version for release.

    ctalkington committed Aug 26, 2017
    Copy the full SHA
    f6ba2ce View commit details
  4. revert the usage of const since it cant be redefined causing potentia…

    …l issues when cwd is used but use var to fix the undefined issue.
    ctalkington committed Aug 26, 2017
    Copy the full SHA
    efeb0d4 View commit details
  5. bump version for release.

    ctalkington committed Aug 26, 2017
    Copy the full SHA
    b36a832 View commit details

Commits on Oct 11, 2017

  1. [WIP] use glob in place of walkdir. (#275)

    use glob in place of walkdir. allow directory data function to ignore entries by explicitly returning false. remove glob error prefix and use error object provided.
    ctalkington authored Oct 11, 2017
    Copy the full SHA
    3009425 View commit details
  2. Copy the full SHA
    8b0bd23 View commit details

Commits on Oct 12, 2017

  1. bump for release.

    ctalkington committed Oct 12, 2017
    Copy the full SHA
    3d0f974 View commit details

Commits on Oct 28, 2017

  1. Fix relative symlink paths (#293)

    jswidler authored and ctalkington committed Oct 28, 2017
    Copy the full SHA
    0bc4872 View commit details
  2. consistent indentation (#294)

    Kelly Selden authored and ctalkington committed Oct 28, 2017
    Copy the full SHA
    d809684 View commit details

Commits on Jan 10, 2018

  1. bump version for release.

    ctalkington committed Jan 10, 2018
    Copy the full SHA
    c0afb03 View commit details
  2. Copy the full SHA
    d43f922 View commit details

Commits on May 24, 2018

  1. Update appveyor.yml

    ctalkington authored May 24, 2018
    Copy the full SHA
    4114b7e View commit details
  2. Update appveyor.yml

    ctalkington authored May 24, 2018
    Copy the full SHA
    df9df76 View commit details
  3. Update appveyor.yml

    ctalkington authored May 24, 2018
    Copy the full SHA
    1da73a3 View commit details
  4. Update appveyor.yml

    ctalkington authored May 24, 2018
    Copy the full SHA
    69030ec View commit details
  5. Add Node.js 10 to CI setting (#320)

    abetomo authored and ctalkington committed May 24, 2018
    Copy the full SHA
    27c67b6 View commit details
  6. Avoid using deprecated Buffer constructor (#312)

    Buffer.concat([]) returns an empty buffer all the way down to 0.8.x.
    
    Refs:
    https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
    ChALkeR authored and ctalkington committed May 24, 2018
    Copy the full SHA
    30a39d5 View commit details
  7. Remove unnecessary return and fix indentation (#297)

    * Remove unnecessary return
    
    * Fix indentation
    abetomo authored and ctalkington committed May 24, 2018
    Copy the full SHA
    7490165 View commit details
  8. Update package.json

    ctalkington authored May 24, 2018
    Copy the full SHA
    e91b685 View commit details
  9. Update package.json

    ctalkington authored May 24, 2018
    Copy the full SHA
    dc926cc View commit details
  10. Update appveyor.yml

    ctalkington authored May 24, 2018
    Copy the full SHA
    587f16b View commit details

Commits on Jun 21, 2018

  1. Copy the full SHA
    467e5c6 View commit details

Commits on Aug 10, 2018

  1. switch to specialized lodash.assign npm module (#335)

    this optimizes node_modules size, reducing about 5 megabytes down to 32 kilobytes
    starpit authored and ctalkington committed Aug 10, 2018
    Copy the full SHA
    d0fb05b View commit details
  2. Update CHANGELOG.md

    ctalkington authored Aug 10, 2018
    Copy the full SHA
    b34b0f0 View commit details
  3. Update CHANGELOG.md

    ctalkington authored Aug 10, 2018
    Copy the full SHA
    0029744 View commit details
  4. Update CHANGELOG.md

    ctalkington authored Aug 10, 2018
    Copy the full SHA
    3311b6d View commit details
  5. Update CHANGELOG.md

    ctalkington authored Aug 10, 2018
    Copy the full SHA
    0b74bbf View commit details
  6. add package-lock.json

    ctalkington committed Aug 10, 2018
    Copy the full SHA
    683bc00 View commit details
  7. update CHANGLOG

    ctalkington committed Aug 10, 2018
    Copy the full SHA
    f7889bf View commit details

Commits on Aug 22, 2018

  1. Small fixes (#339)

    * follow node LTS, node 4 has reached it’s end of life in April
    
    * Removed lodash completely
    
    * Removed deprecated constructor
    jimmywarting authored and ctalkington committed Aug 22, 2018
    Copy the full SHA
    dd7f10d View commit details
  2. changelog updates

    ctalkington committed Aug 22, 2018
    Copy the full SHA
    4641cbf View commit details
  3. update archiver deps.

    ctalkington committed Aug 22, 2018
    Copy the full SHA
    0a1d8b4 View commit details
  4. bump for release.

    ctalkington committed Aug 22, 2018
    Copy the full SHA
    78c7c39 View commit details
  5. Copy the full SHA
    49e2c3f View commit details
  6. Copy the full SHA
    c2f3705 View commit details

Commits on Aug 23, 2018

  1. Copy the full SHA
    34cd7b5 View commit details

Commits on Mar 15, 2019

  1. Create netlify.toml

    ctalkington authored Mar 15, 2019
    Copy the full SHA
    e99c366 View commit details
  2. Update README.md

    ctalkington authored Mar 15, 2019
    Copy the full SHA
    610102d View commit details
  3. Update README.md

    ctalkington authored Mar 15, 2019
    Copy the full SHA
    3f7975c View commit details
  4. Update netlify.toml

    ctalkington authored Mar 15, 2019
    Copy the full SHA
    e807f38 View commit details
  5. Update zip.js

    ctalkington authored Mar 15, 2019
    Copy the full SHA
    b30a99b View commit details

Commits on Apr 29, 2019

  1. update deps.

    ctalkington committed Apr 29, 2019
    Copy the full SHA
    86c3719 View commit details
  2. Copy the full SHA
    488f204 View commit details

Commits on Jul 19, 2019

  1. update deps.

    ctalkington committed Jul 19, 2019
    Copy the full SHA
    615f115 View commit details
  2. bump version for release,

    ctalkington committed Jul 19, 2019
    Copy the full SHA
    042e7a2 View commit details
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "06:05"
open-pull-requests-limit: 12
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "06:00"
open-pull-requests-limit: 12
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2.3.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.0
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: |
npm ci
npm test
env:
CI: true
30 changes: 30 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node Publish Package

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/setup-node@v2.1.0
with:
node-version: 12
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: actions/setup-node@v2.1.0
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
name: Update Release Draft
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
npm-debug.log
package-lock.json
node_modules/
tmp/
test/fixtures/bench
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

90 changes: 87 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,90 @@
## Changelog

**2.0.0** — <small>_July 5th, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.3.0...2.0.0)
**5.0.0** - <small>_July 22, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/4.0.2...5.0.0)

* breaking: absolute path glob patterns are no longer supported: use cwd option instead.
* Replaced glob with readdir-glob to be memory efficient (#433) @Yqnn
* Bump zip-stream from 4.0.0 to 4.0.2 (#431) @dependabot
* Bump zip-stream from 3.0.1 to 4.0.0 (#430) @dependabot
* Bump mocha from 6.2.3 to 8.0.1 (#424) @dependabot
* Bump tar from 4.4.13 to 6.0.2 (#426) @dependabot
* Bump tar-stream from 2.1.2 to 2.1.3 (#427) @dependabot
* Bump rimraf from 2.7.1 to 3.0.2 (#425) @dependabot
* Bump actions/setup-node from v1 to v2.1.0 (#428) @dependabot
* Bump actions/checkout from v1 to v2.3.1 (#429) @dependabot
* Bump lodash from 4.17.15 to 4.17.19 (#423) @dependabot

**4.0.2** - <small>_July 11, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/4.0.1...4.0.2)

- update to async@^3.2.0 (#420)

**4.0.1** - <small>_April 14, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/4.0.0...4.0.1)

- update to zip-stream@^3.0.1

**4.0.0** - <small>_April 14, 2020_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.1.1...4.0.0)

- breaking: slowly catch up with node LTS, remove support for versions under 8.
- update multiple deps.
- fix for a hang with _statQueue (#388)

**3.1.1** - <small>_August 2, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.1.0...3.1.1)

- update zip-stream to v2.1.2

**3.1.0** - <small>_August 2, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.3...3.1.0)

- update zip-stream to v2.1.0

**3.0.3** - <small>_July 19, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.2...3.0.3)

- test: now targeting node v12
- other: update zip-stream@2.0.0

**3.0.2** - <small>_July 19, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.1...3.0.2)

- other: update dependencies

**3.0.1** - <small>_July 19, 2019_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/3.0.0...3.0.1)

- other: update dependencies
- docs: now deployed using netlify

**3.0.0** - <small>_August 22, 2018_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.1.1...3.0.0)

- breaking: follow node LTS, remove support for versions under 6. (#339)
- bugfix: use stats in tar.js and core.js (#326)
- other: update to archiver-utils@2 and zip-stream@2
- other: remove lodash npm module usage (#335, #339)
- other: Avoid using deprecated Buffer constructor (#312)
- other: Remove unnecessary return and fix indentation (#297)
- test: now targeting node v10 (#320)

**2.1.1** — <small>_January 10, 2018_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.1.0...2.1.1)

- bugfix: fix relative symlink paths (#293)
- other: coding style fixes (#294)

**2.1.0** — <small>_October 12, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.3...2.1.0)

- refactor: `directory` now uses glob behind the scenes. should fix some directory recursion issues. (#267, #275)
- docs: more info in quick start. (#284)

**2.0.3** — <small>_August 25, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.2...2.0.3)

- bugfix: revert #261 due to potential issues with editing entryData in special cases.
- bugfix: add var to entryData in glob callback (#273)

**2.0.2** — <small>_August 25, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.1...2.0.2)

- docs: fix changelog date.

**2.0.1** — <small>_August 25, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/2.0.0...2.0.1)

- bugfix: add const to entryData in glob callback (#261)
- other: coding style fixes (#263)

**2.0.0** — <small>_July 5, 2017_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.3.0...2.0.0)

- feature: support for symlinks. (#228)
- feature: support for promises on `finalize`. (#248)
@@ -9,7 +93,7 @@
- change: errors and warnings now contain extended data (where available) and have standardized error codes (#256)
- change: removal of deprecated `bulk` functionality. (#249)
- change: removal of internal `_entries` property in favor of `progress` event. (#247)
- change: support for node v0.4+ only. node v0.10 and v0.12 support has been dropped. (#241)
- change: support for node v4.0+ only. node v0.10 and v0.12 support has been dropped. (#241)

**1.3.0** — <small>_December 13, 2016_</small> — [Diff](https://github.com/archiverjs/node-archiver/compare/1.2.0...1.3.0)

@@ -49,4 +133,4 @@
- simpler path normalization as path.join was a bit restrictive. #162
- move utils to separate module to DRY.

[Release Archive](https://github.com/archiverjs/node-archiver/releases)
[Release Archive](https://github.com/archiverjs/node-archiver/releases)
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Archiver v2.0.0

[![Build Status](https://travis-ci.org/archiverjs/node-archiver.svg?branch=master)](https://travis-ci.org/archiverjs/node-archiver) [![Build status](https://ci.appveyor.com/api/projects/status/38kqu3yp159nodxe/branch/master?svg=true)](https://ci.appveyor.com/project/ctalkington/node-archiver/branch/master)
# Archiver

a streaming interface for archive generation

Visit the [API documentation](http://archiverjs.com/docs) for a list of all methods available.
Visit the [API documentation](https://www.archiverjs.com/) for a list of all methods available.

## Install

@@ -22,22 +20,30 @@ var archiver = require('archiver');
// create a file to stream archive data to.
var output = fs.createWriteStream(__dirname + '/example.zip');
var archive = archiver('zip', {
zlib: { level: 9 } // Sets the compression level.
zlib: { level: 9 } // Sets the compression level.
});

// listen for all archive data to be written
// 'close' event is fired only when a file descriptor is involved
output.on('close', function() {
console.log(archive.pointer() + ' total bytes');
console.log('archiver has been finalized and the output file descriptor has closed.');
});

// This event is fired when the data source is drained no matter what was the data source.
// It is not part of this library but rather from the NodeJS Stream API.
// @see: https://nodejs.org/api/stream.html#stream_event_end
output.on('end', function() {
console.log('Data has been drained');
});

// good practice to catch warnings (ie stat failures and other non-blocking errors)
archive.on('warning', function(err) {
if (err.code === 'ENOENT') {
// log warning
// log warning
} else {
// throw error
throw err;
// throw error
throw err;
}
});

@@ -73,6 +79,7 @@ archive.directory('subdir/', false);
archive.glob('subdir/*.txt');

// finalize the archive (ie we are done appending files but streams have to finish yet)
// 'close', 'end' or 'finish' may be fired right after calling this method so register to them beforehand
archive.finalize();
```

@@ -82,4 +89,4 @@ Archiver ships with out of the box support for TAR and ZIP archives.

You can register additional formats with `registerFormat`.

_Formats will be changing in the next few releases to implement a middleware approach._
_Formats will be changing in the future to implement a middleware approach._
8 changes: 3 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '6'
- nodejs_version: '4'
- nodejs_version: '12'
- nodejs_version: '10'
install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
- npm -g install npm@latest
- set PATH=%APPDATA%\npm;%PATH%
- npm install
matrix:
@@ -18,4 +16,4 @@ clone_depth: 1
test_script:
- node --version
- npm --version
- npm test
- npm test
2 changes: 1 addition & 1 deletion benchmark/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function binaryBuffer(n) {
var buffer = new Buffer(n);
var buffer = Buffer.alloc(n);

for (var i = 0; i < n; i++) {
buffer.writeUInt8(i&255, i);
4 changes: 2 additions & 2 deletions benchmark/simple/pack-zip.js
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ var fs = require('fs');
var mkdir = require('mkdirp');
var streamBench = require('stream-bench');

var archiver = require('../../lib/archiver');
var archiver = require('../../');
var common = require('../common');

var binaryBuffer = common.binaryBuffer;
@@ -55,4 +55,4 @@ archive.pipe(bench);

archive
.file(file, { name: 'large file' })
.finalize();
.finalize();
Loading