@nkbt/geovis-mock

1.1.3 • Public • Published

geovis-mock npm

Discord

CircleCI Coverage Dependencies Dev Dependencies

Mock to feed GeoVis server with data

Installation

npm install --global @nkbt/geovis-mock

Usage

Running mock

CLI

> WS_HOST=localhost WS_PORT=10000 geovis-mock

API

const {run} = require('@nkbt/geovis-mock');

const {
  WS_HOST = 'localhost',
  WS_PORT = 10000
} = process.env;

run({WS_HOST, WS_PORT});

Logging

06:38 $ ./bin.js 
connecting to ws://localhost:10000...
connected
>> {"action":"GEO_BROADCAST","payload":[{"srcLat":55.751244,"srcLon":37.618423,"dstLat":49.246292,"dstLon":-123.116226,"value":3}]}
>> {"action":"GEO_BROADCAST","payload":[{"srcLat":50.411198,"srcLon":30.446634,"dstLat":55.751244,"dstLon":37.618423,"value":4}]}
>> {"action":"GEO_BROADCAST","payload":[{"srcLat":-33.865143,"srcLon":151.2099,"dstLat":-12.462827,"dstLon":130.841782,"value":6}]}
disconnected

Development and testing

Currently is being developed and tested with the latest stable Node 6 under OSX.

git clone git@github.com:nkbt/geovis-mock.git
cd geovis-mock
npm install

Tests

# to run tests
npm test

# to generate test coverage (./coverage)
npm run cov

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @nkbt/geovis-mock

Weekly Downloads

0

Version

1.1.3

License

MIT

Last publish

Collaborators

  • nkbt