Skip to content

Commit c2a1eed

Browse files
committed
docs: update
1 parent 9f51710 commit c2a1eed

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
![action status](https://github.com/yeonjuan/parse-git-diff/actions/workflows/main.yml/badge.svg?branch=main)
2-
[![npm version](https://badge.fury.io/js/parse-git-diff.svg)](https://badge.fury.io/js/parse-git-diff)
2+
[![npm version](https://badge.fury.io/js/parse-git-diff.svg)](https://www.npmjs.com/package/parse-git-diff)
3+
[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
34

45
# parse-git-diff
56

7+
A parser for git diff.
8+
69
## Installation
710

811
```bash
@@ -11,13 +14,28 @@ npm install parse-git-diff
1114

1215
## Demo
1316

14-
- [demo](https://yeonjuan.github.io/parse-git-diff/)
17+
See [online demo](https://yeonjuan.github.io/parse-git-diff/)
1518

1619
## Usage
1720

1821
```js
1922
import parseGitDiff from 'parse-git-diff';
20-
parseGitDiff('...');
23+
24+
const result = parseGitDiff('... git diff ...');
25+
26+
console.log(result);
27+
// {
28+
// "type": "GitDiff",
29+
// "files": [
30+
// {
31+
// "type": "AddedFile",
32+
// "chunks": [
33+
// {
34+
// "type": "Chunk",
35+
// "toFileRange": {
36+
// "start": 1,
37+
// ...
38+
// }
2139
```
2240

2341
## Examples
@@ -446,4 +464,4 @@ index 0e05564..aa39060 100644
446464

447465
## License
448466

449-
- [MIT](./LICENSE)
467+
[MIT](./LICENSE)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "parse-git-diff",
33
"version": "0.0.6",
4-
"description": "Parse git diff",
4+
"description": "A parser for git diff",
55
"main": "build/index.umd.js",
66
"module": "build/index.module.js",
77
"types": "build/index.d.ts",

0 commit comments

Comments
 (0)