fifatables-stream
v0.0.4
Published
Streams for Fifa Soccer Game tables
Downloads
1
Maintainers
Readme
Library that provides stream for reading or writing data of Fifa Soccer tables
Install
Nodejs 12 or higher need to be installed first
npm install fifatables-stream
or
yarn add fifatables-stream
Quick start
Type this into your ts file.
import { join } from 'path';
import { cwd } from 'process';
import { Fifa, fifaConfig, Table } from 'fifatables';
import { readCsvStream, writeCsvStream } from 'fifatables-stream';
// read league.txt from Fifa 11
readCsvStream(join(cwd(), 'examples', Fifa.Fifa11), Table.Leagues, fifaConfig(Fifa.Fifa11).leagues)
.on('data', (buffer: Buffer) => console.log(JSON.parse(buffer.toString())))
.on('finish', () => console.log('Reading finished.'));
// read league.txt from Fifa 11 and write it in Fifa 21 format
const table = Table.Leagues;
const readStream = readCsvStream(join(cwd(), 'examples', Fifa.Fifa11), table, fifaConfig(Fifa.Fifa11).leagues);
writeCsvStream(readStream, join(cwd(), 'output', Fifa.Fifa21), table, fifaConfig(Fifa.Fifa21).leagues)
.on('data', (buffer: Buffer) => console.log(JSON.parse(buffer.toString())))
.on('finish', () => console.log('Writing finished.'));
Supported versions of Fifa Soccer
See library fifatables.
Supported tables
See library fifatables.
License
Copyright © 2022 - 2023 Dominik Hladik
All contents are licensed under the MIT license.