Skip to content

Commit 46d37b0

Browse files
Update README.md
1 parent 9aebf2a commit 46d37b0

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

README.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,33 @@ A CLI tool for comparing files (JSON/YAML) and displaying differences in multipl
2020

2121
## Installation
2222

23-
1. Make sure you have Node.js version 14 or higher installed.
24-
2. Clone the repository:
25-
```bash
26-
git clone https://github.com/ElenaManukyan/Difference-Calculator.git
27-
```
28-
3. Navigate to the project directory:
29-
```bash
30-
cd Difference-Calculator
31-
```
32-
4. Install dependencies:
33-
```bash
34-
npm install
35-
```
23+
```bash
24+
# Clone repository
25+
git clone https://github.com/ElenaManukyan/Difference-Calculator.git
26+
cd Difference-Calculator
27+
28+
# Install dependencies
29+
npm install
30+
31+
# Install globally (optional)
32+
npm install -g .
33+
```
3634

3735
## Development and Testing
38-
### Linting:
39-
The project uses ESLint with Airbnb's coding standards. To lint the code, run:
4036
```bash
37+
# Run linter
4138
npx eslint .
42-
```
43-
or:
44-
```bash
4539
make lint
46-
```
47-
### Testing:
48-
Tests are written using the Jest framework. To run all tests, execute:
49-
```bash
40+
41+
# Run tests
5042
npm test
51-
```
52-
or:
53-
```bash
5443
make test
55-
```
56-
### Formatting:
57-
To ensure consistent code style, use Prettier:
58-
```bash
44+
45+
# Run formatter
5946
npx prettier --write .
60-
```
47+
```
6148

6249
## Usage
63-
The gendiff command compares two files and outputs their differences.
6450
```
6551
gendiff -h
6652
Usage: gendiff [options] <filepath1> <filepath2>
@@ -71,9 +57,26 @@ Options:
7157
-V, --version output the version number
7258
-f, --format <format> output format (default: "stylish")
7359
-h, --help display help for command
60+
```
61+
## Examples
62+
### Compare flat files
63+
```
64+
# JSON files
65+
gendiff file1.json file2.json
66+
67+
# YAML files
68+
gendiff file1.yml file2.yml
69+
```
70+
### Compare nested structures
71+
```
72+
# With plain format
73+
gendiff --format plain nested1.json nested2.json
74+
75+
# Get JSON output
76+
gendiff --format json nested1.yml nested2.yml
7477
```
7578

76-
## Usage examples:
79+
## Demo:
7780
### Creating difference between 2 flat .json files:
7881
<a href="https://asciinema.org/a/wFWF5AqXjojXDuEojlMvfCECk" target="_blank"><img src="https://asciinema.org/a/wFWF5AqXjojXDuEojlMvfCECk.svg" /></a>
7982
### Creating difference between 2 flat .yml files:

0 commit comments

Comments
 (0)