0.2.1 • Published 2 years ago

screp-js-file v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Apache 2.0 license npm version

screp-js-file

A pure Javascript version of screp, a StarCraft: Remastered replay file parser, compiled from the original Go version using GopherJS.

screp (StarCraft: Brood War Replay Parser) is a library for extracting information from StarCraft replay files. This library uses a compiled version of the original library recompiled for Javascript. This specific library is designed to for use in Node on local files—if you need to parse file buffers directly or use screp in the browser, try screp-js.

Installation

This library can be installed through npm:

npm i --save screp-js-file

Usage

To use, run Screp.parseFile() on a path to a local file.

const Screp = require('screp-js-file')

const processRep(filepath) {
  try {
    const res = await Screp.parseFile(filepath)
    return res
  }
  catch (err) {
    // If something went wrong, 'err' will be an Error object containing a string thrown by Go.
    console.log(err)
  }
}

For more information, see the screp-js documentation.

Copyright

Apache License 2.0, as per the original screp project.