Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/celtian/fifatables-stream
Streams for Fifa Soccer Game tables
https://github.com/celtian/fifatables-stream
library typescript
Last synced: about 10 hours ago
JSON representation
Streams for Fifa Soccer Game tables
- Host: GitHub
- URL: https://github.com/celtian/fifatables-stream
- Owner: Celtian
- License: mit
- Created: 2022-07-18T20:26:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-02T12:10:52.000Z (over 1 year ago)
- Last Synced: 2024-11-11T16:23:09.567Z (5 days ago)
- Topics: library, typescript
- Language: TypeScript
- Homepage:
- Size: 43.1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
fifatables-stream
[![npm version](https://badge.fury.io/js/fifatables-stream.svg)](https://badge.fury.io/js/fifatables-stream)
[![Package License](https://img.shields.io/npm/l/fifatables-stream.svg)](https://www.npmjs.com/fifatables-stream)
[![NPM Downloads](https://img.shields.io/npm/dm/fifatables-stream.svg)](https://www.npmjs.com/fifatables-stream)
[![Build & Publish](https://github.com/celtian/fifatables-stream/workflows/Build%20&%20Publish/badge.svg)](https://github.com/celtian/fifatables-stream/actions)
[![codecov](https://codecov.io/gh/Celtian/fifatables-stream/branch/master/graph/badge.svg?token=1IRUKIKM0D)](https://codecov.io/gh/celtian/fifatables-stream/)
[![stars](https://badgen.net/github/stars/celtian/fifatables-stream)](https://github.com/celtian/fifatables-stream/)
[![forks](https://badgen.net/github/forks/celtian/fifatables-stream)](https://github.com/celtian/fifatables-stream/)
[![HitCount](http://hits.dwyl.com/celtian/fifatables-stream.svg)](http://hits.dwyl.com/celtian/fifatables-stream)> Library that provides stream for reading or writing data of Fifa Soccer tables
## Install
_Nodejs 12 or higher need to be installed first_
```terminal
npm install fifatables-stream
```or
```terminal
yarn add fifatables-stream
```## Quick start
_Type this into your ts file._
```terminal
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](https://www.npmjs.com/package/fifatables).
## Supported tables
See library [fifatables](https://www.npmjs.com/package/fifatables).
## License
Copyright © 2022 - 2023 [Dominik Hladik](https://github.com/Celtian)
All contents are licensed under the [MIT license].
[mit license]: LICENSE