Skip to content

Commit

Permalink
[Docs] Add usage information for the shim/monkey-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
adamvoss authored and ljharb committed Jul 13, 2017
1 parent ddb4556 commit 38b1ee5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ This package provides the built-in `util.promisify` in node v8.0.0 and later, an

## Usage

**Direct**
```js
const promisify = require('util.promisify')
// Use `promisify` just like the built-in
const promisify = require('util.promisify');
// Use `promisify` just like the built-in method on `util`
```

**Shim**
```js
require('util.promisify/shim')();
// `util.promisify` is now defined
const util = require('util');
// Use `util.promisify`
```

Note: this package requires a native ES5 environment, and for `Promise` to be globally available. It will throw upon requiring it if these are not present.

0 comments on commit 38b1ee5

Please sign in to comment.