From 4d25ea6de8bf037b4311e3a20fc81b552d2086bb Mon Sep 17 00:00:00 2001 From: Chris Talkington <chris@talkingtontech.com> Date: Fri, 5 Jun 2015 12:09:03 -0500 Subject: [PATCH] update README [ci skip] --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ec4f632c..cba41663 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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.