Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

legoino-util

Package Overview
Dependencies
Maintainers
7
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

legoino-util

Create and parse compact logs.

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
7
Weekly downloads
 
Created
Source

legoino-util

NPM version build status David deps npm download

Create and parse compact logs.

Installation

$ npm install legoino-util

API Documentation

Example

Create compact log

'use strict';

const { createCompactLog } = require('legoino-util');

let result = createCompactLog(
  {
    id: 65535,
    epoch: 32767,
    parameters: {
      A: 1,
      B: 2,
      C: 3,
      D: 4
    },
    eventId: 5,
    eventValue: 6,
    deviceId: 0xaaaa - 65536
  },
  4
);
// result is a string with value '0000FFFF00007FFF000100020003000400050006AAAA87'

Parse current settings

'use strict';

const { parseCurrentSettings } = require('legoino-util');

let result = parseCurrentSettings('0000FFFF00007FFF000100020003000400050006AAAA87');
// result is a JSON (object)

Parse multi-logs

Parse many lines of logs in one go. The lines must be separated by carriage returns.

'use strict';

const { parseMultilog } = require('legoino-util');

var multilog = `
000100005B77EFBE0046000E003800000000000000000013000C00060000005100010011004080000000000004D242
000100015B77EFC10046000E003800000000000000000044003200100000002000020011004080000000000004D231
000100025B77EFC40047000E00380000000000020002002F0024000A0000003500010011004080000000000004D247
`

let result = parseMultilog(multilog);
// result is a JSON (array of objects)

License

MIT

Keywords

FAQs

Package last updated on 23 Nov 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc