madden-draft-class-tools
v1.2.0
Published
A library to read/write Madden draft class files
Readme
Madden Draft Class Tools
This library provides functionality for reading and writing Madden NFL draft class files.
Features
- Read draft class as JSON
- Write Madden draft class from JSON
Supported Games
- Madden NFL 25
- Madden NFL 26
Installation
- Install the npm package:
npm install madden-draft-class-tools - Run tests:
mocha ./tests/*.spec.js
Available Functions
readDraftClass(fileBuf: buffer): Object
This function takes in the buffer of a Madden draft class file as fileBuf and returns the draft class as a JSON object, with the following general structure:
{
"header": {
// File header data, you shouldn't need to modify this
},
"prospects": [
{
"firstName": string,
"lastName": string,
"position": number,
...
}
]
}Note that enum values are represented as numbers in the JSON object. You will have to translate these yourself if you want to display them nicely.
writeDraftClass(draftClass: Object): Buffer
This function writes the draft class JSON object to the Madden draft class file format and returns the file buffer. The draftClass object should have the same structure as the object returned by readDraftClass.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
See the LICENSE file for license details.
