connectordb
v0.0.11
Published
ConnectorDB javascript client
Downloads
1
Readme
ConnectorDB Javascript Client
This is the official javascript client for ConnectorDB. It is compatible with node, react-native, and the browser.
Installing
node
npm install connectordb --save
Browser
You can download one of the releases (release tabs).
Building
git clone https://github.com/connectordb/connectordb-javascript
cd connectordb-javascript
npm install
npm run build
You can run node tests by running connectordb in test mode:
connectordb create testdb --test
connectordb start testdb
connectordb run testdb &
npm run check
If making modifications, you can make sure your modifications work in the browser by using browsertest.html
Usage
Browser
<html>
<head>
<!-- You can also use requirejs -->
<script src="connectordb.min.js"></script>
</head>
<body>
<script>
cdb = connectordb.ConnectorDB("apikey")
// All functions return promises
cdb.readUser("myuser").done(function(result) {
console.log("User Nickname: " + result.name);
});
</script>
</body>
</html>
Node/react-native
connectordb = require("connectordb.min.js");
cdb = connectordb.ConnectorDB("apikey")
// All functions return promises
cdb.readUser("myuser").done(function(result) {
console.log("User Nickname: " + result.name);
});