NESU
Search…
Setup

As CLI

Run this to install Nesu as a global package:
1
$ npm install -g @rappopo/nesu
Copied!
Go to your project folder, and invoke:
1
$ nesu
Copied!
The first time Nesu starts, it’ll create an empty config.json configuration file, transformer and last_seq folder in your project folder. Quit Nesu by pressing Ctrl-c and start customizing its configurations (please see details below).

As Library

Go to your node.js application project folder, and type:
1
$ npm install --save @rappopo/nesu
Copied!
Create an empty new js file, e.g.: nesu.js, and enter the following code:
1
var nesu = require('@rappopo/nesu')
2
nesu()
Copied!
Also create the config.json configuration file in the same folder as nesu.js file above like this example below:
1
{
2
"db": {
3
"mydb1": {
4
"idleTimeout": 0
5
},
6
"mydb2": {
7
"cdb": {
8
"url": "http://couchdb:5984",
9
"name": "mycouchdb1"
10
},
11
"es": {
12
"url": "http://elasticsearch:9200",
13
"name": "myesindex1"
14
},
15
"bulkLimit": 500,
16
"idleTimeout": 10
17
}
18
},
19
"default": {
20
"bulkLimit": 5000
21
}
22
}
Copied!
And finaly:
1
$ node nesu.js
Copied!
But most likely you’ll want to use a process manager like pm2.
Program will automatically create an empty config.js file if missing. Two empty folders transformer and last_seq will also be created.
You might also want to change the configuration object above dynamically within your script, like this:
1
...
2
nesu({ config: <config> })
3
...
Copied!
The value of <config> will simply be merged with the above configuration file.
Last modified 3yr ago
Copy link