Skip to content

Commit

Permalink
docs: update README.md to remove references to cb() form
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jun 17, 2024
1 parent 8e2d0a1 commit 42260a6
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ npm install gitlog --save
## Usage

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

const options = {
repo: __dirname + "/test-repo-folder",
Expand All @@ -21,22 +21,7 @@ const options = {
execOptions: { maxBuffer: 1000 * 1024 },
};

// Synchronous
const commits = gitlog(options);
console.log(commits);

// Asynchronous (with Callback)
gitlog(options, function (error, commits) {
// Commits is an array of commits in the repo
console.log(commits);
});

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

// Asynchronous (with Promise)
gitlogPromise(options)
.then((commits) => console.log(commits))
.catch((err) => console.log(err));
const commits = await gitlogPromise(options);
```

`gitlog` comes with full typescript support!
Expand Down

0 comments on commit 42260a6

Please sign in to comment.