mamma
v0.5.0
Published
offers baby monitors which will provide peace of mind to new mothers
Downloads
18
Readme
mamma
Offers baby monitors which will provide peace of mind to the new mother.
Open TCP or Unix domain socket and listen child KA keepalive noises.
Alert (callback) when close
event happen
Installation
Install through NPM
npm install mamma
or
git clone git://github.com/hex7c0/mamma.git
API
inside nodejs project
var server = require('mamma').createServer;
var client = require('mamma').createClient;
var bind = require('mamma').createBinding; // bind to existing TCP server
createServer(listen [, options])
listen
listen
- Number | String Number forTCP port
, String (path) forsock
(default "required")
options
keepalive
- Number Set initialDelay (in milliseconds) to set the delay between the last data packet received and the first keepalive probe (default "2000")callback
- Function Set callback whenclose
event happen (return had_error,id) (default "disabled")http
- Object Enable http interface (default "disabled")port
- Number Set Web port (default "3000")host
- String Set Web host (default "127.0.0.1")
https
- Object Enable https interface extra options (default "disabled")port
- Number Set Web port (default "3000")host
- String Set Web host (default "127.0.0.1")
host
- String If the host is omitted, the server will accept connections directed to any IPv4 address (TCP only) (default "omitted")
createClient(connect, id [, options])
connect
connect
- Object createConnection (default "required")
id
id
- String Child id for callback (default "required")
options
autoReconnect
- Boolean Set autoReconnect flag (default "true")maxRetries
- Number Set maxRetries for autoReconnect logic (true for unlimited) (default "true")delay
- Number Set millisecond delay from each try (default "2000")
createBinding(connect, id [, options])
connect
connect
- Object createConnection (default "required")
id
id
- String Child id for callback (default "required")
options
autoReconnect
- Boolean Set autoReconnect flag (default "true")maxRetries
- Number Set maxRetries for autoReconnect logic (true for unlimited) (default "true")delay
- Number Set millisecond delay from each try (default "2000")keepalive
- Number Set initialDelay (in milliseconds) to set the delay between the last data packet received and the first keepalive probe (default "2000")callback
- Function Set callbackclose
event happen (return had_error,id) (default "disabled")
Examples
Take a look at my examples