Skip to content

Commit 3747826

Browse files
authored
Merge pull request #386 from benjamine/site
fix: README badges & npm prepack
2 parents e71364c + d036168 commit 3747826

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ lib
2020

2121
npm-debug.log
2222
.idea/
23+
24+
packages/jsondiffpatch/README.md
25+
packages/jsondiffpatch/MIT-LICENSE.txt
26+
27+
*.local.*

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
1-
# jsondiffpatch
1+
<p align="center">
2+
<h1 align="center">jsondiffpatch</h1>
3+
<p align="center">
4+
<a href="https://jsondiffpatch.com">jsondiffpatch.com</a>
5+
<br/>
6+
Diff & patch JavaScript objects
7+
</p>
8+
</p>
29

310
<!--- badges -->
4-
5-
[![Build Status](https://secure.travis-ci.org/benjamine/jsondiffpatch.svg)](http://travis-ci.org/benjamine/jsondiffpatch)
6-
[![Code Climate](https://codeclimate.com/github/benjamine/jsondiffpatch/badges/gpa.svg)](https://codeclimate.com/github/benjamine/jsondiffpatch)
7-
[![Test Coverage](https://codeclimate.com/github/benjamine/jsondiffpatch/badges/coverage.svg)](https://codeclimate.com/github/benjamine/jsondiffpatch)
8-
[![NPM version](https://badge.fury.io/js/jsondiffpatch.svg)](http://badge.fury.io/js/jsondiffpatch)
9-
[![NPM dependencies](https://david-dm.org/benjamine/jsondiffpatch.svg)](https://david-dm.org/benjamine/jsondiffpatch)
10-
11-
Diff & patch JavaScript objects
11+
<p align="center">
12+
<a href="https://github.com/benjamine/jsondiffpatch/actions?query=branch%3Amaster"><img src="https://github.com/benjamine/jsondiffpatch/actions/workflows/CI.yml/badge.svg?event=push&branch=master" alt="JsonDiffPatch CI status" /></a>
13+
<a href="https://twitter.com/beneidel" rel="nofollow"><img src="https://img.shields.io/badge/created%[email protected]" alt="Created by Benjamin Eidelman"></a>
14+
<a href="https://opensource.org/licenses/MIT" rel="nofollow"><img src="https://img.shields.io/github/license/benjamine/jsondiffpatch" alt="License"></a>
15+
<a href="https://www.npmjs.com/package/jsondiffpatch" rel="nofollow"><img src="https://img.shields.io/npm/dw/jsondiffpatch.svg" alt="npm"></a>
16+
<a href="https://github.com/benjamine/jsondiffpatch" rel="nofollow"><img src="https://img.shields.io/github/stars/benjamine/jsondiffpatch" alt="stars"></a>
17+
</p>
1218

1319
---
1420

15-
## **[Live Demo](http://benjamine.github.io/jsondiffpatch/index.html)**
21+
## **[Live Demo](https://jsondiffpatch.com)**
1622

1723
- min+gzipped ~ 16KB
1824
- browser and server (ESM-only)
25+
- deep diff, use delta to patch
1926
- (optionally) uses [google-diff-match-patch](http://code.google.com/p/google-diff-match-patch/) for long text diffs (diff at character level)
2027
- smart array diffing using [LCS](http://en.wikipedia.org/wiki/Longest_common_subsequence_problem), **_IMPORTANT NOTE:_** to match objects inside an array you must provide an `objectHash` function (this is how objects are matched, otherwise a dumb match by position is used). For more details, check [Array diff documentation](docs/arrays.md)
21-
- reverse a delta
22-
- unpatch (eg. revert object to its original state using a delta)
28+
- reverse a delta, unpatch (eg. revert object to its original state using a delta)
2329
- simplistic, pure JSON, low footprint [delta format](docs/deltas.md)
2430
- multiple output formatters:
25-
- html (check it at the [Live Demo](http://benjamine.github.io/jsondiffpatch/index.html))
31+
- html (check it at the [Live Demo](https://jsondiffpatch.com))
2632
- annotated json (html), makes the JSON delta format self-explained
2733
- console (colored), try running `./node_modules/.bin/jsondiffpatch left.json right.json`
2834
- JSON Patch format RFC 6902 support
@@ -31,7 +37,7 @@ Diff & patch JavaScript objects
3137

3238
## Supported platforms
3339

34-
- Any browser that supports ES6
40+
- Any browser that [supports ES6](https://caniuse.com/es6)
3541
- Node.js 18, 20+
3642

3743
## Usage
@@ -270,7 +276,7 @@ const jsondiffpatchInstance = jsondiffpatch.create({
270276
</html>
271277
```
272278

273-
To see formatters in action check the [Live Demo](http://benjamine.github.io/jsondiffpatch/index.html).
279+
To see formatters in action check the [Live Demo](https://jsondiffpatch.com).
274280

275281
For more details check [Formatters documentation](docs/formatters.md)
276282

docs/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ For more details check [delta format documentation](deltas.md)
7676

7777
#### Html
7878

79-
On html you will see moves as fancy curved arrows (check [Live Demo](http://benjamine.github.com/jsondiffpatch/demo/index.html) ), these are implemented using SVG elements and an embedded script tag, they will only show up [if your browser supports SVG](http://caniuse.com/svg)
79+
On html you will see moves as fancy curved arrows (check [Live Demo](https://jsondiffpatch.com) ), these are implemented using SVG elements and an embedded script tag, they will only show up [if your browser supports SVG](http://caniuse.com/svg)

docs/deltas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This format was created with a balance between readability and low footprint in
88
- to represent changed parts, arrays and magic numbers are used to keep a low footprint (i.e. you won't see verbosity like `"type": "added"`)
99
- keep it pure JSON serializable
1010

11-
A great way to understand this format is using the "Annotated JSON" option in the [Live Demo](http://benjamine.github.io/jsondiffpatch/index.html), and try the different left/right examples, or edit left/right JSON to see the annotated delta update as your type.
11+
A great way to understand this format is using the "Annotated JSON" option in the [Live Demo](https://jsondiffpatch.com)), and try the different left/right examples, or edit left/right JSON to see the annotated delta update as your type.
1212

1313
Here's a complete reference of this format.
1414

docs/formatters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Formatters
22

3-
Some formatters are included that let you convert a JSON delta into other formats, you can see some of these used in the [Live Demo](https://benjamine.github.io/jsondiffpatch/index.html)
3+
Some formatters are included that let you convert a JSON delta into other formats, you can see some of these used in the [Live Demo](https://jsondiffpatch.com))
44

55
## Html
66

packages/jsondiffpatch/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsondiffpatch",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"author": "Benjamin Eidelman <[email protected]>",
55
"description": "Diff & Patch for Javascript objects",
66
"contributors": [
@@ -30,7 +30,7 @@
3030
"type-check": "tsc --noEmit",
3131
"lint": "eslint . --ext .ts",
3232
"test": "jest --coverage",
33-
"prepack": "npm run build",
33+
"prepack": "npm run build && cp ../../MIT-LICENSE.txt . && cp ../../README.md .",
3434
"prepublishOnly": "npm run test && npm run lint"
3535
},
3636
"repository": {

0 commit comments

Comments
 (0)