tja

TJA parser for JavaScript and Node.js

tja.js is a parsing library for the TJA (Taikojiro) file format. This format is used by Taiko simulators. It contains the metadata and the notation for all of the song's difficulty levels.

Disclaimer: The library is in early development and may undergo several breaking changes after receiving community feedback.

Getting Started

1. Install the library:

npm install tja
# or
yarn add tja

2. Import the parser:

import { TJAParser } from 'tja';

// or

const { TJAParser } = require('tja');

...or if you're in a browser environment:

<script src="https://cdn.jsdelivr.net/npm/tja@0.1/dist/browser/tja.min.js"></script>
<script>
const { TJAParser } = window.TJA;
</script>

3. Parse a TJA file:

const contents = fs.readFileSync('Saitama2000.tja', 'utf8');
try {
const song = TJAParser.parse(contents);
console.log(song);
} catch (e) {
console.error(e);
}

Please refer to the documentation for more information about the models, properties, and methods that are at your disposal.

TODO

  • Support for #SENOTECHANGE
  • Unit tests

Attributions

Thanks to bui for providing a comprehensive specification for the TJA format. The documentation was also mostly based on this their guide.

Here are some additional sources they've linked in their guide:

License

MIT.

Generated using TypeDoc