0.5.2 • Published 3 years ago

pulsat.io v0.5.2

Weekly downloads
56
License
GPL-3.0
Repository
github
Last release
3 years ago

From latin, pulsatio means heartbeat / beating / pulse

Simple heartbeat server and client to manage overall agents and discovery, supports automatic replication and it can also be used with your existing express instance

quick-start

  • install
npm i pulsat.io
  • server
const Pulsatio = require('pulsat.io');
const ps = new Pulsatio({ mode: 'server' });
  • client
const Pulsatio = require('pulsat.io');
const pc = new Pulsatio();

middlewares

  • on connection (server)
new Pulsatio({
    mode: 'server',
    on: {
        connection: (node, next) => {
            console.log('new connection')
            node.a = 'b'
            next()
        }
    }
});

listeners

  • on connection (client)
new Pulsatio({
    on: {
        connection: (data) => {
            console.log(data)
        }
    }
})

options

  • server
OptionTypeRequiredDefault
portintegerOptional4200
expressexpress instanceOptionalexpress new instance
interval_timeoutfloatOptional1.1
vpnbooleanOptionalfalse
replicationstringOptionalnull
replication_prefixstringOptional''
  • client
OptionTypeRequiredDefault
urlstringOptional'http://localhost:4200'
idstringOptionalgenerated uuid
intervalintegerOptional30000

endpoints

EndpointType
/nodes/:idGET, POST, PUT, DELETE
/nodesGET, POST
/nodes/onlineGET

other clients

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.3

4 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago