Socket
Socket
Sign inDemoInstall

@varunaiot/varunalib

Package Overview
Dependencies
4
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@varunaiot/varunalib

VarunaLib is the library of the [Digital Performance Twin API](https://github.com/decagonhq/varunax), a software that helps manage water stations, utility company's assets and help to deliver safe and quality water across the network, monitoring and predi


Version published
Maintainers
1
0
Bundle size
11.7 kB
Minified + gzipped

Weekly downloads

Readme

Source

Node.js CI

VarunaLib

VarunaLib is the library of the Digital Performance Twin API, a software that helps manage water stations, utility company's assets and help to deliver safe and quality water across the network, monitoring and predicting asset failures in real time

Getting Started

These instructions will get you a copy of the library up and running on your local machine for data crunching purposes.

Prerequisites

Here are list of things you need to get started

  • Globally install node
  • Globally install yarn

Installing

A step by step series of examples that tell you how to get a development env running

  • Run in your terminal within your projects directory

npm i @varunaiot/varunalib

How to use

The varunalib consist of 4 functions

  • GetAverageORP
  • GetAveragePH
  • PumpRuntime
  • Flowrate

GetAverageORP function

This function calculates the Average ORP of a given set of ORPs between two dates. To make use of this function do the following

import {GetAverageORP} from "@varunaiot/varunalib"

GetAverageORP(startTime: Date, endTime: Date, previousData: Array<Object>)

Parameters involved include

  • startTime (DateTime):- The start date for processing the ORP
  • endTime (DateTime):- This is the endDate for processing the ORP
  • previousData (Array):- this is the historical data that is to be processed to get out the ORP

Expected Result

  • return { orpAverage, orpData, orpInfo };

GetAveragePH function

This function calculates the Average PH of a given set of PHs between two dates. To make use of this function do the following

import {GetAveragePH} from "@varunaiot/varunalib"

GetAveragePH(startTime: Date, endTime: Date, previousData: Array<Object>)

Parameters involved include

  • startTime (DateTime):- The start date for processing the PH
  • endTime (DateTime):- This is the endDate for processing the PH
  • previousData (Array):- this is the historical data that is to be processed to get out the PH

Expected Result

  • return { phAverage, phData, phInfo };

PumpRuntime function

This function calculates the pump runtime of a given set of runtimes between two dates. To make use of this function do the following

import {PumpRuntime} from "@varunaiot/varunalib"

PumpRuntime(startTime: Date, endTime: Date, previousData: Array<Object>, pumpId: String)

Parameters involved include

  • startTime (DateTime):- The start date for processing the PH
  • endTime (DateTime):- This is the endDate for processing the PH
  • previousData (Array):- this is the historical data that is to be processed to get out the PH
  • pumpId (String):- The symbol of the pump whose runtime is needed

Expected Result

  • return runtime;

Flowrates function

This function calculates the pump runtime of a given set of runtimes between two dates. To make use of this function do the following

import {Flowrates} from "@varunaiot/varunalib"

Flowrates(startTime: Date,
  endTime: Date,
  assets: Array<Object>,
  pumpData: Array<Object>,
  pumpType: String)

Parameters involved include

  • startTime (DateTime):- The start date for processing the PH
  • endTime (DateTime):- This is the endDate for processing the PH
  • pumpData (Array):- This is the historical data that is to be processed to get out the PH
  • assets: (Array):- This is an array of all assets in the database ,
  • pumpType (String):- The type of the pump whose Flowrate is needed

Expected Result

  • return flows;

And coding style

  • Our coding style can be found here

Deployment

Add additional notes about how to deploy this on a live system

Built With

  • TypeScript

Authors

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

FAQs

Last updated on 21 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc