Skip to content

Commit

Permalink
Docs: Document use method
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Apr 30, 2023
1 parent 878d587 commit f03ebcf
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ const yauzl = require('yauzl-promise').useYauzl(yauzlFork, { clone: false });
assert(yauzl === yauzlFork);
```

#### Using another version of `yauzl` and alternative Promise implementation

`.use()` method does both of the above.

```js
const yauzlCrc = require('yauzl-crc');
const Bluebird = require('bluebird');
const yauzl = require('yauzl-promise').use(Bluebird, yauzlCrc);
```

The yauzl object passed is cloned before it is modified, unless you set `clone` option to `false`:

```js
const yauzlFork = require('my-yauzl-fork');
const yauzl = require('yauzl-promise').use(Bluebird, yauzlFork, { clone: false });
assert(yauzl === yauzlFork);
```

## Versioning

This module follows [semver](https://semver.org/). Breaking changes will only be made in major version updates.
Expand Down

0 comments on commit f03ebcf

Please sign in to comment.