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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tls-xml

v0.0.17

Published

Moudle for work with tls socket that receives xml payload.

Readme

TLS-XML Library

This library is used to work with tls connection that sends and receives payload of format:

0-4 Bytes: Payload Length
4-8 Bytes: CommandID
8- remaining: Payload

API

new SecurifiSocket([options])

  • options Object
    • host String
    • port Number
    • rejectUnauthorized Boolean

Construct a new socket object.

socket.send(commandName, data)

  • commandName String
  • data Object

Sends command with commandName and data through tls connection. data is JSON object.

Available commands:

  • login
  • almond_list
  • device_value
  • device_data
  • mobile_command

JSON commands:

  • update_index
  • device_list

Command: "update_index":

 {
    "MobileInternalIndex":689,
    "CommandType":"UpdateDeviceIndex",
    "ID":<device_id>,
    "Index":<value_index>,
    "Value":<value>,
    "AlmondMAC": <almond_mac>
 }

Command "device_list"

 {
    "MobileInternalIndex":355,
    "CommandType":"DeviceList" ,
    "AlmondMAC":<almond_mac>,
    "Action": "get"
 }

Event: 'data'

function(data) { }

When this event emitted JSON object is passed to data variable.

Event: 'error'

function (error) { }

If the internal tls socket emits an error, this event is emitted.

Event: 'open'

function () { }

Emitted when the tls connection is established.

Example

var SecurifiSocket = require('tls-xml');

Options is used to connect to server thhrough tls connection.

var options = {
      host: '102.13.54.134',
      port: 5000,
      rejectUnauthorized:false		
}

var socket = new SecurifiSocket(options):

socket.on('open', function() {
	console.log('Connection opened');
})

Lock example:

securifi.lock('full', {
    macAddress:"25117621634324",
    devices: ["1","2","3"],
    lockout: {
      coolingSetpoint:{
        min: 40,
        max: 50
      },
      heatingSetpoint: {
        min: 60,
        max:70
      },
      duration: 360,
      pin: 1111,
      allowedModes:{}
    }
  })

Unlock example:

securifi.unlock({
    macAddress:"25117621634324",
    devices: ["1","2","3"]
  })

"device_list" response:

{
   "CommandType":"DeviceList",
   "Success":true,
   "Reason":null,
   "AlmondMAC":251176216341111,
   "Devices":{
      "1":{
         "Data":{
            "ID":1,
            "Type":62,
            "Name":"Zen Thermostat #1",
            "AssociationTimeStamp":null,
            "FriendlyDeviceType":null,
            "Location":"Default"
         },
         "DeviceValues":{
            "1":{
               "Name":"SENSOR MULTILEVEL",
               "Value":"83.3"
            },
            "2":{
               "Name":"THERMOSTAT MODE",
               "Value":"Heat"
            },
            "3":{
               "Name":"THERMOSTAT OPERATING STATE",
               "Value":""
            },
            "4":{
               "Name":"THERMOSTAT SETPOINT HEATING",
               "Value":"49"
            },
            "5":{
               "Name":"THERMOSTAT SETPOINT COOLING",
               "Value":"40"
            },
            "6":{
               "Name":"THERMOSTAT FAN MODE",
               "Value":"Auto Low"
            },
            "7":{
               "Name":"THERMOSTAT FAN STATE",
               "Value":""
            },
            "8":{
               "Name":"BATTERY",
               "Value":""
            },
            "9":{
               "Name":"UNITS",
               "Value":""
            },
            "10":{
               "Name":"CUSTOM_MESSAGE",
               "Value":""
            }
         }
      }
   }
}