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

node-djiparsetxt

v0.2.12

Published

command-line application that reads a DJI '.txt' file and outputs a json.

Downloads

26

Readme

node-djiparsetxt

npm NPM

Decrypts and parse DJI logs and outputs csv files, along other things. Based on djiparsetxt.

This package requires node version 10 or older. Basically the stable release.

Usage

From the terminal

The main use case for is through a terminal to create json version of logs.

The cli's format is:

	node-djiparsetxt FILE [FILE...] [OPTIONS]

Type node-djiparsetxt --help for more info on options.

Example to create a json file from a text log:

	node-djiparsetxt log1.txt > log1.json

If you want to output csv:

	node-djiparsetext log1.txt --csv > log1.csv

From a script

node-djiparsetxt supports usage as a library to integrate it to a bigger workflow or to create batch processing of log files.

Example script that prints preformatted json file from a log file:

const djiparsetxt = require('node-djiparsetxt');
const fs = require('fs');

const file_path = "path_to_log.txt";

fs.readFile(file_path, (err, data) => {
	if (err) throw err;
	console.log(JSON.stringify(djiparsetxt.parse_file(data), null, 4));
});

node-djiparsetxt Module

parse_file(buf: Buffer, filter: (IRowObject) => boolean): IRowObject[]

Parse a given buffer and return an array of IRowObject instances.

If a filter parameter is given, then only the rows that return filter(row) true is returned in the array.

Parameters

  • buf: Buffer: Buffer instance of the file to parse.
  • filter: (IRowObject) => boolean: Filter function to specify what rows to include.

Returns

An array of with the rows extracted from the file.


get_details(buf: Buffer): any

Get the details section of the given file.

Parameters

  • buf: Buffer: Buffer instance of the file to parse.

Returns

An object with properties and values from the details area.


get_header(buf: Buffer): IHeaderInfo

Get the header of the given file.

Parameters

  • buf: Buffer: Buffer instance of the file to parse.

Returns

IHeaderInfo structure from the file.


get_kml(buf: Buffer, image?: string, removeNoSignalRecords: boolean = false): Promise<string>

Returns a kml string from a given file buffer.

Parameters

  • buf: Buffer: Buffer instance of the file to parse.
  • image?: string: Image to use as background for the kml.
  • removeNoSignalRecords: boolean: If to remove rows where there was no GPS signal.

Returns

A string with the kml file.