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

ualf

v3.1.2

Published

LLPS/CGLSS (UALF) data parser

Downloads

59

Readme

ualf

LLPS/CGLSS (UALF) data parser

Package status Build status Code coverage License

A tiny package for parsing LLPS/CGLSS (UALF) strings.

Getting started

Installing

Use the following command to add it to your dependencies:

npm install --save ualf

Usage

import ualf from "ualf";

ualf(
  "0 2017 10 16 16 01 07 345596160 65.5204 12.7377 -87 " +
    "0 12 17 134.27 0.40 0.40 0.72 13.1 10.0 -0.0 1 1 0 1"
);

output is an object with the following key-value pairs for the given string above:

({
  version: "0",
  date: Date,
  year: "2017",
  month: "10",
  day: "16",
  hour: "16",
  hours: "16",
  minutes: "01",
  seconds: "07",
  nanoseconds: "345596160",
  nano: "345596160",
  latitude: "65.5204",
  lat: "65.5204",
  longitude: "12.7377",
  long: "12.7377",
  lng: "12.7377",
  peakCurrent: "-87",
  multiplicity: "0",
  numSensors: "12",
  numberOfSensors: "12",
  freedom: "17",
  degreesOfFreedom: "17",
  ellipseAngle: "134.27",
  semiMajorAxis: "0.40",
  semiMinorAxis: "0.40",
  chiSquareValue: "0.72",
  riseTime: "13.1",
  peakToZeroTime: "10.0",
  maxRateOfRise: "-0.0",
  cloudIndicator: "1",
  angleIndicator: "1",
  signalIndicator: "0",
  timingIndicator: "1",
});

For numerical output, use the attached asNumbers function:

import * as ualf from "ualf";

ualf(
  "0 2017 10 16 16 01 07 345596160 65.5204 12.7377 -87 " +
    "0 12 17 134.27 0.40 0.40 0.72 13.1 10.0 -0.0 1 1 0 1"
);

output is an object with the following key-value pairs for the given string above:

({
  version: 0,
  date: Date,
  year: 2017,
  month: 10,
  day: 16,
  hour: 16,
  hours: 16,
  minutes: 01,
  seconds: 07,
  nanoseconds: 345596160,
  nano: 345596160,
  latitude: 65.5204,
  lat: 65.5204,
  longitude: 12.7377,
  long: 12.7377,
  lng: 12.7377,
  peakCurrent: -87,
  multiplicity: 0,
  numSensors: 12,
  numberOfSensors: 12,
  freedom: 17,
  degreesOfFreedom: 17,
  ellipseAngle: 134.27,
  semiMajorAxis: 0.4,
  semiMinorAxis: 0.4,
  chiSquareValue: 0.72,
  riseTime: 13.1,
  peakToZeroTime: 10.0,
  maxRateOfRise: -0.0,
  cloudIndicator: 1,
  angleIndicator: 1,
  signalIndicator: 0,
  timingIndicator: 1,
});

Specification

The UALF "specification" looks something like this. Each of these named segments have been extracted as their own key-value pair of the resulting object returned from calling this package. All values are kept as strings to retain leading zeroes.

{
  version,
  date, // Date object with the passed date and time
  year,
  month,
  day,
  hour,
  hours, // alias for `hour`
  minutes,
  seconds,
  nanoseconds,
  nano, // alias for `nanoseconds`
  latitude,
  lat, // alias for `latitude`
  longitude,
  long, // alias for `longitude`
  lng, // alias for `longitude`
  peakCurrent,
  multiplicity,
  numberOfSensors,
  numSensors, // alias for `numberOfSensors`
  degreesOfFreedom,
  freedom, // alias for `degreesOfFreedom`
  ellipseAngle,
  semiMajorAxis,
  semiMinorAxis,
  chiSquareValue,
  riseTime,
  peakToZeroTime,
  maxRateOfRise,
  cloudIndicator,
  angleIndicator,
  signalIndicator,
  timingIndicator;
}

Contribution

This package is open to pull requests. To set up the test environment, fork it, clone it, and run

npm install

in the package's folder.

To run unit tests:

npm test

To build:

npm build

Compatibility

This package is compatible with Node versions 14 and up.

Changelog

Changelog is available at the repository.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Further reading

For more information on the specifics of LLPS/CGLSS, and their data format UALF, check this document or this abstract.