From be484f83c563349bb66c6dbfcd85414d295be786 Mon Sep 17 00:00:00 2001 From: francisc0j0shua Date: Thu, 12 Apr 2018 19:35:34 +0200 Subject: [PATCH 1/3] Typos in README Just some typos. :smiley: Thanks for all your fantastic work on this project. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a0b470dc..b4cd2e69 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ GUN is a realtime, distributed, offline-first, graph database engine. Doing **[2 ## Why? - - **Realtime** - You might use socketio for realtime updates, but what happens if you reload the page? GUN solves *state synchronization* for you, no matter what, on reloads, across all your users, and even on conflicting updates. + - **Realtime** - You might use Socket.IO for realtime updates, but what happens if you reload the page? GUN solves *state synchronization* for you, no matter what, on reloads, across all your users, and even on conflicting updates. - **Distributed** - GUN is peer-to-peer by design, meaning you have no centralized database server to maintain or that could crash. This lets you sleep through the night without worrying about database DevOps - we call it "NoDB". From there, you can build decentralized, federated, or centralized apps. - **Offline-first** - GUN works even if your internet or cell reception doesn't. Users can still plug away and save data as normal, and then when the network comes back online GUN will automatically synchronize all the changes and handle any conflicts for you. - **Graph** - Most databases force you to bend over backwards to match their storage constraints. But graphs are different, they let you have any data structure you want. Whether that be traditional tables with relations, document oriented trees, or tons of circular references. You choose. @@ -204,7 +204,7 @@ Or, if you prefer your Docker image with metadata labels (Linux/Mac only): ```bash npm run docker -docker run -p 8080:8080 usenameHere/gun:git +docker run -p 8080:8080 username/gun:git ``` Then visit [http://localhost:8080](http://localhost:8080) in your browser. From 841574f1cf1d14bd3ecf59107e504a9e7343554a Mon Sep 17 00:00:00 2001 From: masterex1000 Date: Mon, 14 May 2018 22:03:11 -0600 Subject: [PATCH 2/3] Add Node Support Added three lines to the top of the gun/lib/time.js file to add basic node.js support. --- lib/time.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/time.js b/lib/time.js index 49781786..8fb429ce 100644 --- a/lib/time.js +++ b/lib/time.js @@ -1,3 +1,7 @@ +if(typeof window === "undefined"){ //Not in the browser, Include from node + var Gun = require('gun/gun'); +} + ;(function(){ var ify = Gun.node.ify, u; Gun.chain.time = function(data, a, b){ @@ -139,4 +143,4 @@ at = at.slice(-7); return new Date(Date.UTC(at[0], parseFloat(at[1])-1, at[2], at[3], at[4], at[5], at[6])); } -}()); \ No newline at end of file +}()); From da085eeb1547411a63659023ab19f394c716a9be Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Wed, 16 May 2018 11:17:21 -0700 Subject: [PATCH 3/3] get ( soul ) --- gun.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gun.js b/gun.js index 2c830835..cb94a956 100644 --- a/gun.js +++ b/gun.js @@ -1193,10 +1193,10 @@ ;USE(function(module){ var Gun = USE('./root'); Gun.chain.get = function(key, cb, as){ - var gun; + var gun, tmp; if(typeof key === 'string'){ var back = this, cat = back._; - var next = cat.next || empty, tmp; + var next = cat.next || empty; if(!(gun = next[key])){ gun = cache(key, back); } @@ -1217,6 +1217,9 @@ } else if(num_is(key)){ return this.get(''+key, cb, as); + } else + if(tmp = rel.is(key)){ + return this.get(tmp, cb, as); } else { (as = this.chain())._.err = {err: Gun.log('Invalid get request!', key)}; // CLEAN UP if(cb){ cb.call(as, as._.err) }