npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

liquidsensors

v0.8.0

Published

Npm package to control,save,retrieve and display data from sensors integrating the liquid galaxy pataform

Downloads

30

Readme

Renato-Fernandes-GSoC2019

Proposal

Javascript library to acquire and display data from sensors

GitHub repo size npm npm

Current Public Methods

Obs: All of the methods return promises

createConnection(Object)

This method will create a new connection with a Postgre instance. It will create defaults tables if none is found

createConnection({
    host: '',
    port: 3306,
    user: '',
    password: '',
    database: ''
})

deleteSensor

Delete a sensor by its name

deleteSensor(name)

editSensor

Given a sensor name the library will update a sensor information given what is passed in the info object

editSensor(name, info = {
    name: "",
    description: "",
    ip: "",
    unit: "",
    lon: "",
    lat: "",
    img: "",
    unitdesc: ""
})

getAllSensors

This method do not recieve any parameters and returns all of sensors name with the owner and icon url

getAllSensors()

getFullSensors

This method returns everything about a sensors and its owner but he email and hashed password

getFullSensors()

getInfo

Returns all information about a registered sensor by its name

getInfo(name)

getSensorPosition

Returns the latitude and longitude of the sensor found by its name

getSensorPosition(name)

getUser

Returns everything about a user, Name,Email and the hashed password. you can provide ethier the name, email or databaseID for this method

getUser(param)

readSensor

Returns an array with wall lines from the readings table. Every element contains "sensorID, unit, value, date"

The datespan argument set a time span for the dabatase to compare. It can be one of the values below:

1y 6m 1m 1w 1d

Being as y=year m=month w=week d=day

readSensor(name,datespan)

readUserSensors

Returns all of the user sensors by the user name

readUserSensors(name)

registerRead

Register a new value for the sensor by its name.

Decimal: tells the library where the floating point is. Some sensors vendos make the information coming out of the board a whole number without decimals. So if you have a number like this "123456789" and you want "12345.6789", just pass 4 into the decimal parameter.

hex: if true, the library will try to convert de value from hexadecimal to decimal. It needs to be a number after conversion

registerRead(name, value, decimal, hex = false)

registerSensor

Register a sensor for a given user name,the username will set the owner of the sensor. If no information is passed after the username in the function call everything will default for the values below. obs: imgId is to identify a image by url in the aforementioned front-end app.

obs2: unitdes is a long version of the unit. For example: unit = Km/H unitdesc = Kilometers per Hour

registerSensor(username,{
    name= "Default sensor n: ",
    description= "Default description",
    unit= "To be set",
    lat= 0,
    lon= 0,
    imgId= "",
    unitdesc = "To be set"
})

registerUser

Given a user name, password and email this method will store everything in the database. obs: The password will be hashed using sha512

registerUser = ({
    userName=null,
    userPass=null,
    userMail=null
})

Stashed changes