1.0.7 • Published 5 years ago

json-url-diff v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

JSON URL Diff

Uses json-diff to get differences between two hosted JSON documents and print pretty diff to console

Usage

npm install --save json-url-diff

 const urlDiff = require('json-url-diff')

Define an array of arrays for either:

  1. checking absolute
  2. checking relative urls to JSON documents
 const files = {
   //check absolute urls
   feed:['https://jsonplaceholder.typicode.com/photos/1', 'https://jsonplaceholder.typicode.com/photos/2'],
   //check relative urls (host1, host2, relative path)
   feed2:['http://alpha.mysite.com', 'http://mysite.com','/feeds/90212e56-9762-490c-aa69-b399d9f09485']
 }

Log diff function

urlDiff(files).then(console.log)

Prints each diff:

============= feed =============
{
-  id: 2
+  id: 1
-  title: "reprehenderit est deserunt velit ipsam"
+  title: "accusamus beatae ad facilis cum similique qui sunt"
-  url: "https://via.placeholder.com/600/771796"
+  url: "https://via.placeholder.com/600/92c952"
-  thumbnailUrl: "https://via.placeholder.com/150/771796"
+  thumbnailUrl: "https://via.placeholder.com/150/92c952"
}

============= feed2 =============
Error: Request failed with status code 404
1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago