new ModFile( file_object )

Description
A File Object representing a file of a specific mod
Parameters
Name Type Description
file_object Object File object to create object from
Properties
Name Type Description
minecraft_versions Array.<string> The minecraft versions this mod file is compatible with.
file_name string The name of the mod file it got stored with.
file_size string The size of the mod file as string. (Yeah it's gross)
release_type string the type of the mod file release.
mod_key string The Curse slug of the mod the file belongs to.
download_url string The url to the mod file to download.
downloads number The amount of downloads of this mod file.
timestamp timestamp A timestamp of the time the file got uploaded.
mod_dependencies Array.<string> A list of dependencies for this file.
available boolean true if the file is available.
Details

Methods


<static> download( path, override, simulate, callback ) → {Promise.<path>}

Description
Download the file to a specific file
Parameters
Name Type Description
path string absolute path to save the mod to.
override boolean Should the file be overwritten if it already exists? Defaults to false.
simulate boolean Doesn't download a file it just tries to find the proper website. Used for testing.
callback function Optional callback to use as alternative to Promise.
Returns
A Promise containing the selected absolute path for convenience.
Details

<static> getDependencies( callback [, categories ] ) → {Promise.<Array.<Mod>, Error>}

Description
Get all dependencies required by this mod.
Parameters
Name Type Attributes Default Description
callback function Optional callback to use as alternative to Promise
categories array <optional>
[1,3] Array of categories to get the Dependencies for. @see CurseForgeAPI.DEPENDENCY_TYPE
Returns
Array of Mods who are marked as dependency or an empty array if no dependencies exist.
Details

<static> getDependenciesFiles( callback [, categories ] ) → {Promise.<Array.<ModFile>, Error>}

Description
Get all dependencies required by this mod.
Parameters
Name Type Attributes Default Description
callback function Optional callback to use as alternative to Promise
categories array <optional>
[3] Array of categories to get the Dependencies for. @see CurseForgeAPI.DEPENDENCY_TYPE
Returns
Array of ModFiles who are marked as dependency or an empty array if no dependencies exist.
Details