Skip to content
This repository was archived by the owner on Dec 11, 2022. It is now read-only.

Commit 892f527

Browse files
committed
Better readme.
1 parent b271838 commit 892f527

File tree

4 files changed

+46
-16
lines changed

4 files changed

+46
-16
lines changed

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
# <img alt="logo" src="https://raw.githubusercontent.com/sciactive/2be-extras/master/logo/product-icon-40-bw.png" align="top" /> Nymph - Node Client Files
1+
# Nymph Node Client - collaborative app data
22

3-
This repository contains the node client files required by Nymph. For a directory of all official Nymph repositories, check out the [main Nymph repository](https://github.com/sciactive/nymph).
3+
[![Latest Stable Version](https://img.shields.io/npm/v/nymph-client-node.svg?style=flat)](https://www.npmjs.com/package/nymph-client-node) [![License](https://img.shields.io/npm/l/nymph-client-node.svg?style=flat)](https://www.npmjs.com/package/nymph-client-node) [![Open Issues](https://img.shields.io/github/issues/sciactive/nymph-client-node.svg?style=flat)](https://github.com/sciactive/nymph-client-node/issues)
44

5-
## Nymph Node Client
5+
Nymph is an object data store that is easy to use in JavaScript and PHP.
66

7-
The Nymph client requires some browser globals that Node doesn't provide, so this repository sets up some globals to provide them.
7+
## Installation
8+
9+
You can install Nymph Node Client with NPM.
10+
11+
```sh
12+
npm install --save nymph-client-node
13+
```
14+
15+
This repository is the JavaScript client for Node. There is also a **[browser client](https://github.com/sciactive/nymph-client)**. For more information, you can see the [main Nymph repository](https://github.com/sciactive/nymph).
16+
17+
The Nymph client requires some browser globals that Node doesn't provide, so this client sets up some globals to provide them.
818

919
It also sets up Nymph.init to also call PubSub.init with your configs, so you don't need to set up PubSub yourself.
1020

11-
## How to Install and Use Nymph in Node
21+
## Setting up Nymph in Node.js
1222

13-
To install, use npm:
23+
<div dir="rtl">Quick Setup with NPM</div>
1424

15-
```
16-
npm install --save nymph-client-node
25+
```sh
26+
npm install --save nymph-client
1727
```
1828

1929
To use, require it as the Nymph object:
@@ -26,8 +36,8 @@ Then provide the options to Nymph.init:
2636

2737
```js
2838
Nymph.init({
29-
restURL: 'http://...',
30-
pubsubURL: 'ws://...',
39+
restURL: 'https://yournymphrestserver/path/to/your/rest.php',
40+
pubsubURL: 'wss://yournymphpubsubserver:8080',
3141
rateLimit: 100
3242
});
3343
```
@@ -38,4 +48,19 @@ Now include your entity classes, such as `Todo`, and you can write queries and s
3848
Nymph.getEntities({'class': Todo.class}, {'type': '&', 'strict': ['name', 'Foobar']}).subscribe((todos) => {
3949
console.log("\nNew Foobar Todo Updates: ", todos);
4050
});
51+
52+
const myTodo = new Todo();
53+
myTodo.set({
54+
name: "Foobar",
55+
done: false
56+
});
57+
myTodo.save().then(() => {
58+
alert("You've got new todos!");
59+
});
4160
```
61+
62+
For a thorough step by step guide to setting up Nymph on your own server, visit the [Setup Guide](https://github.com/sciactive/nymph/wiki/Setup-Guide).
63+
64+
## Documentation
65+
66+
Check out the documentation in the wiki, [Technical Documentation Index](https://github.com/sciactive/nymph/wiki/Technical-Documentation).

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Nymph Node Client
2+
3+
// (really, it's just the browser client with some Node libraries to supply fake
4+
// browser globals.)
5+
16
// Do aliases to get around Node modules.
27
const nymphPath = require.resolve('nymph-client').replace(/lib\/Nymph(?:\.js)?$/, '');
38
const alias = require('module-alias');

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nymph-client-node",
3-
"version": "0.0.1-alpha2",
3+
"version": "0.0.1-alpha3",
44
"description": "A client wrapper for using Nymph in Node.js.",
55
"main": "index.js",
66
"scripts": {
@@ -21,7 +21,7 @@
2121
"homepage": "https://github.com/sciactive/nymph-client-node#readme",
2222
"dependencies": {
2323
"module-alias": "^2.0.1",
24-
"nymph-client": "^1.6.1",
24+
"nymph-client": "^2.2.0",
2525
"websocket": "^1.0.24",
2626
"xmlhttprequest": "^1.8.0"
2727
}

0 commit comments

Comments
 (0)