Skip to content

Commit

Permalink
update README [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
ctalkington committed Jun 5, 2015
1 parent 2aae944 commit 4d25ea6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ a streaming interface for archive generation
npm install archiver --save
```

You can also use `npm install https://github.com/archiverjs/node-archiver/archive/master.tar.gz` to test upcoming versions.
## Usage

## Archiver

#### create(format, options)
```js
var archiver = require('archiver');
var archive = archiver.create('zip', {}); // or archiver('zip', {});
```

Creates an Archiver instance based on the format (zip, tar, etc) passed. Parameters can be passed directly to `Archiver` constructor for convenience.
## API

### Instance Methods
#### Transform

Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) methods.

#### create(format, options)

Creates an Archiver instance based on the format (zip, tar, etc) passed. Parameters can be passed directly to `Archiver` constructor for convenience.

#### abort()

Aborts the archiving process, taking a best-effort approach, by:
Expand Down Expand Up @@ -96,6 +101,10 @@ Finalizes the instance and prevents further appending to the archive structure (

Returns the current byte length emitted by archiver. Use this in your end callback to log generated size.

#### use(plugin)

Add a plugin to the middleware stack. Currently this is designed for passing the module to use (replaces registerFormat/setFormat/setModule)

## Events

Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) events.
Expand Down

0 comments on commit 4d25ea6

Please sign in to comment.