Skip to content

Commit

Permalink
update readme to fix cjs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Apr 13, 2020
1 parent cbcb26a commit 7cbef29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm install gitlog --save
## Usage

```js
const gitlog = require("gitlog");
const gitlog = require("gitlog").default;

const options = {
repo: __dirname + "/test-repo-folder",
Expand All @@ -34,8 +34,10 @@ gitlog(options, function (error, commits) {
console.log(commits);
});

const { gitlogPromise } = require("gitlog");

// Asynchronous (with Promise)
gitlog(options)
gitlogPromise(options)
.then((commits) => console.log(commits))
.catch((err) => console.log(err));
```
Expand Down

0 comments on commit 7cbef29

Please sign in to comment.