Skip to content

Commit a2c198e

Browse files
committed
docs: update readme
1 parent 697a721 commit a2c198e

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-native-bs-diff-patch
22

3-
rn bs diff patch
3+
rn bs diff patch file
44

55
## Installation
66

@@ -11,11 +11,17 @@ npm install react-native-bs-diff-patch
1111
## Usage
1212

1313
```js
14-
import { multiply } from 'react-native-bs-diff-patch';
14+
import { diff, patch } from 'react-native-bs-diff-patch';
1515

1616
// ...
1717

18-
const result = await multiply(3, 7);
18+
/**
19+
* generate patch file from old file and new file
20+
*/
21+
await diff(oldFile, newFile, patchFile);
22+
// generate new file from old file and patch file
23+
await patch(oldFile, newFile, patchFile);
24+
1925
```
2026

2127
## Contributing

src/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ const BsDiffPatch = NativeModules.BsDiffPatch
1717
}
1818
);
1919

20+
/**
21+
* generate new file from old file and patch file
22+
* @param oldFile orignal file path
23+
* @param newFile new file path
24+
* @param patchFile patch file path
25+
**/
2026
export function patch(
2127
oldFile: string,
2228
newFile: string,
@@ -25,6 +31,13 @@ export function patch(
2531
return BsDiffPatch.patch(oldFile, newFile, patchFile);
2632
}
2733

34+
/**
35+
* generate patch file from old file and new file
36+
* @param oldFile orignal file path
37+
* @param newFile new file path
38+
* @param patchFile patch file path
39+
* @returns
40+
*/
2841
export function diff(
2942
oldFile: string,
3043
newFile: string,

0 commit comments

Comments
 (0)