mirror of
https://github.com/amark/gun.git
synced 2025-07-03 03:12:32 +00:00
yummier quickstart!
This commit is contained in:
parent
e52e5821c1
commit
7dedd0797c
14
README.md
14
README.md
@ -44,23 +44,25 @@ GUN is *super easy* to get started with:
|
|||||||
> If the `npm` command line didn't work, you may need to `mkdir node_modules` first or use `sudo`.
|
> If the `npm` command line didn't work, you may need to `mkdir node_modules` first or use `sudo`.
|
||||||
|
|
||||||
- An online demo of the examples are available here: http://gunjs.herokuapp.com/
|
- An online demo of the examples are available here: http://gunjs.herokuapp.com/
|
||||||
- Or write a quick app: ([try now in jsbin](http://jsbin.com/sovihaveso/edit?js,console))
|
- Or write a quick app: ([try now in a playground](https://jsbin.com/kadobamevo/edit?js,console))
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/gun/gun.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// import GUN from 'gun'; // in ESM
|
// import GUN from 'gun'; // in ESM
|
||||||
// Gun = require('gun'); // in NodeJS
|
// GUN = require('gun'); // in NodeJS
|
||||||
// Gun = require('gun/gun'); // in React
|
// GUN = require('gun/gun'); // in React
|
||||||
gun = GUN();
|
gun = GUN();
|
||||||
|
|
||||||
gun.get('mark').put({
|
gun.get('mark').put({
|
||||||
name: "Mark",
|
name: "Mark",
|
||||||
email: "mark@gunDB.io",
|
email: "mark@gun.eco",
|
||||||
});
|
});
|
||||||
|
|
||||||
gun.get('mark').on(function(data, key){
|
gun.get('mark').on((data, key) => {
|
||||||
console.log("update:", data);
|
console.log("realtime updates:", data);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setInterval(() => { gun.get('mark').get('live').put(Math.random()) }, 9);
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
- Or try something **mind blowing**, like saving circular references to a table of documents! ([play](http://jsbin.com/wefozepume/edit?js,console))
|
- Or try something **mind blowing**, like saving circular references to a table of documents! ([play](http://jsbin.com/wefozepume/edit?js,console))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user