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

drone-log-parser

v2.3.0

Published

A package to parse drone log files to consumable json files

Downloads

9

Readme

drone-log-parser

npm install drone-log-parser

This is a package that attempts to convert the logs of different drones to a more readable JSON object. Currently only supports APM .log files.

It offers 2 functions:

  • log2var: it takes in the path for the log and returns a object variable after parsing

    import {log2var} from 'drone-log-parser';
    
    log2var(myLogPath, (result) => {
        console.log(result);
        // result is the object variable created
        // now you can work with it as you wish
    });
    
  • log2JSON: it takes in the path for the log and the path where you want to put the JSON file. If no JSON path is found it saves the .json file in the same path as the log with a .json extension. Warning, this file are usually very big. If the file already exists, a number is appended to the name of the file.

    import {log2var} from 'drone-log-parser';
    
    log2JSON(myLogPath, myJSONPath);

This would be a sample .log file:

FMT, 128, 89, FMT, BBnNZ, Type,Length,Name,Format,Columns
FMT, 129, 31, PARM, QNf, TimeUS,Name,Value
FMT, 130, 50, GPS, QBIHBcLLeeEefB, TimeUS,Status,GMS,GWk,NSats,HDop,Lat,Lng,RAlt,Alt,Spd,GCrs,VZ,U
FMT, 131, 50, GPS2, QBIHBcLLeeEefB, TimeUS,Status,GMS,GWk,NSats,HDop,Lat,Lng,RAlt,Alt,Spd,GCrs,VZ,U
FMT, 194, 19, GPA, QCCCC, TimeUS,VDop,HAcc,VAcc,SAcc
...
PARM, 2018601318, SYSID_THISMAV, 1
PARM, 2018601327, SYSID_MYGCS, 253
PARM, 2018601337, CLI_ENABLED, 0
...
PIDR, 2170611144, -13.475, -12.12663, 0, -6.892358, 0, 0
PIDP, 2170611148, -0.5099478, -0.3088386, 0, -0.08426516, 0, 0
PIDY, 2170611152, 0, 0, 0, 0, 0, 0
PIDS, 2170611156, 0, 0, 0, 0, 0, 0
EKF1, 2170611174, 5.67, -0.62, 330.99, 0.3472643, 0.01834141, -0.0005736348, 0, 0, 0.2265548, 0.29, -0.57, 0.21
...

And the variable is an object, where each key has the name of the message and consists of an array of all the messages with that header. The JSON function creates a JSON with the same structure as the variable.

{
  "FMT": [
    {
      "Type": 128,
      "Length": 89,
      "Name": "FMT",
      "Format": "BBnNZ",
      "Columns": ["Type","Length","Name","Format","Columns"]
    },
    {
      "Type": 129,
      "Length": 31,
      "Name": "PARAM",
      "Format": "QNf",
      "Columns": ["TimeUS","Name","Value"]
    },
    ...
  ],
  "PARAM": [
    {
      "TimeUS": 2018601318,
      "Name": "SYSID_THISMAV",
      "Value": 1
    },
    {
      "TimeUS": 2018601327,
      "Name": "SYSID_MYGCS",
      "Value": 253
    },
    {
      "TimeUS": 2018601337,
      "Name": "CLI_ENABLED",
      "Value": 0
    },
    ...
  ],
  ...
  "PIDR": [...],
  "PIDP": [...],
  "PIDY": [...],
  "EKF1": [...],
  ...
}