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

@smnirl/act-logparser

v1.0.3

Published

High performance JS parsing library for Advanced Combat Tracker logs.

Downloads

213

Readme

ACT Logparser NodeJS Tests Latest Version

ACT Logparser is a Javascript library for parsing MMO network logs from Advanced Combat Tracker.

It currently supports Final Fantasy 14 (FFXIV), with additional support for log types recorded by OverlayPlugin.

Installation

You can clone the repo, or install via NPM/Yarn/etc with npm i @smnirl/act-logparser

Usage

One-off parsing

The parseLogLine() method will parse a single ACT Network Log line given as a string and return the result, along with the line it appeared on within the stream synchronously.

e.g. 23|2024-12-03T21:16:19.5320000-05:00|66642069|Producer Yoshida|66642069|Please Lookforward Toit|Cancelled|1234abcdefg will return as

{
  "line": 273,
  "log":  {
      "id": "66642069",
      "name": "Please Lookforward Toit",
      "reason": "Cancelled",
      "source": "Producer Yoshida",
      "sourceId": "66642069",
      "timestamp": "2024-12-03T21:16:19.5320000-05:00",
      "type": "23"
    }
}

(The type definitions and log structure data used by this library are also exported as lookup table objects as logTypes, logTypeIds and logTypeStructs for your reference.)

Parsing large files or real-time

The processLogStream() method accepts a ReadStream object and callback function, and will continue to parse the given stream until it ends. This functionality calls the synchronous parseLogLine() method and returns its result to your callback.

Error Handling

The parseLogLine() function does not throw on errors or halt, instead, an error string is returned in the encapsulating object, along with an empty log object and the line of the stream at which the error occurred.

Performance

As ACT network logs are entirely pipe-delimited, I used tokenization for this library instead of regex, as I saw other projects doing. This approach provides a 40-70% speed up in processing time with lower(!) memory usage compared to parsing similarly using regular expressions.

Contributing

If you wish to make an improvement, fix bugs, etc. please feel free to open a Pull Request.

I will accept additions for other games that ACT supports if someone would like to add them, but you must include tests for all log types added. I will reject PRs that add functionality without tests, and PRs that don't pass tests.