Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,36 @@ Node.js add-on (C++) for [SiriDB](https://github.com/SiriDB/siridb-server#readme

## Installation
```
node-gyp configure && node-gyp build
mkdir my_modules
cd my_modules
git clone https://github.com/SiriDB/siridb-nodejs-addon.git siridb
cd ../
npm install ./my_modules/siridb
```

### About Installation

The addon is built using `cmake` and `node-gyp`.


The dependencies are:

* https://github.com/transceptor-technology/libqpack.git
* https://github.com/SiriDB/libsiridb.git
* https://github.com/SiriDB/libsuv.git

The build command is: `node-gyp configure && node-gyp build`

There is `install.sh` script that will install everything, when the package is installed using npm.
It's possible to do the compilation manually, like in install.sh.

The main module file is specified in package.json:

`"main": "build/Release/obj.target/siridb.node"`

## Quick usage
```javascript
const sdbaddon = require('./build/Release/siridb');
const sdbaddon = require('siridb');

var siridb = new sdbaddon.SiriDBClient(
"iris", "siri", "dbtest", "localhost", 9000);
Expand Down
43 changes: 43 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

if "$( which apt-get )" 2> /dev/null; then
echo "detected Debian-based"
sudo apt install cmake libuv1-dev

elif "$( which yum )" 2> /dev/null; then
echo "detected Modern Red Hat-based"
sudo yum install cmake libuv-devel

elif "$( which portage )" 2> /dev/null; then
echo "detected Gentoo-based"
echo "please make sure you have packages: cmake , libuv deveopment"

elif VERB="$( which pacman )" 2> /dev/null; then
echo "detected Arch-based"
echo "please make sure you have packages: cmake , libuv deveopment"
else
echo "can't detect os type";
echo "please make sure you have packages: cmake , libuv deveopment"
fi

npm install -g node-gyp

git clone https://github.com/transceptor-technology/libqpack.git
cd libqpack/Release
make
sudo make install
cd ../../

git clone https://github.com/SiriDB/libsiridb.git
cd libsiridb/Release
make all
sudo make install
cd ../../

git clone https://github.com/SiriDB/libsuv.git
cd libsuv/Release
make
sudo make install
cd ../../

node-gyp configure
node-gyp build
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "siridb",
"version": "1.0.0",
"description": "Node.js add-on (C++) for [SiriDB](https://github.com/SiriDB/siridb-server#readme)",
"main": "build/Release/obj.target/siridb.node",
"directories": {
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"install": "bash install.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SiriDB/siridb-nodejs-addon.git"
},
"author": "",
"license": "ISC",
"gypfile": true,
"bugs": {
"url": "https://github.com/SiriDB/siridb-nodejs-addon/issues"
},
"homepage": "https://github.com/SiriDB/siridb-nodejs-addon#readme"
}