Skip to content

Commit a31804d

Browse files
committed
update: add usage section
1 parent 9509dd4 commit a31804d

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# Wrap-Git
22

3-
wrap-git is a powerful Node.js package that provides an easy way to interact with the GitHub API, supporting both JavaScript and TypeScript.
3+
wrap-git is a powerful Node.js package that provides an easy way to interact with the GitHub API, `supporting both JavaScript and TypeScript`.
44
It wraps various endpoints and operations, enabling developers to access and summarize GitHub data with minimal effort.
55
This package simplifies data retrieval and analysis from GitHub, making it an excellent choice for integrating GitHub functionalities into your applications.
66

77
## Features
88

99
- Fetch user profiles and filter screen data.
10-
- Fetch and filter commits, repositories, and languages coverages.
10+
- Fetch and filter `commits`, `repositories`, and `languages` coverages.
1111
- Analyze commits per each year.
1212
- Analyze repos — tops, star counts, and details.
1313
- Analyze language coverage per each repo, top languages, and percentages.
1414

15-
---
16-
1715
## Installation
1816

1917
Install the package using npm:
@@ -27,11 +25,23 @@ or with yarn:
2725
yarn add wrap-git
2826
```
2927

30-
---
31-
3228
## Usage
29+
You can use the package by importing individual methods or use the default export.
30+
31+
### Option A — Named imports
32+
```ts
33+
import { getUserProfile, commitSummarizar, repoSummarizer, lngSummarizer } from "wrap-git";
34+
35+
const userProfile = await getUserProfile('sgc93'); // don't forget to handle errors
36+
```
37+
38+
### Option B — Default import
39+
```ts
40+
import wrapGit from "wrap-git";
3341

34-
---
42+
const { getUserProfile, commitSummarizar, repoSummarizer, lngSummarizer } = wrapGit;
43+
const userProfile = await getUserProfile('sgc93'); // don't forget to handle errors
44+
```
3545

3646
## Contributing
3747

@@ -42,8 +52,6 @@ We welcome contributions! Feel free to submit issues or create pull requests.
4252
3. Make your changes.
4353
4. Submit a pull request.
4454

45-
---
46-
4755
## License
4856

4957
This project is licensed under the MIT License. See the LICENSE file for details

0 commit comments

Comments
 (0)