node-factorio-api
Download and update mods from the Factorio Mod Portal


Table of Contents
Features
Installation
I recommend using yarn instead of npm, because it's (a lot) faster.
yarn add node-factorio-api (or npm install node-factorio-api)
Usage
import {Profile, FactorioAPI, Progress, Mod} from "./node-factorio-api";
Progress.subscribe(tasks => {
tasks.map(task => console.log(`${task.name}: ${task.progress}`));
console.log("\n");
});
(async () => {
let profile = new Profile("/home/daan/Games/factorio/");
await profile.authenticate();
FactorioAPI.useProfile(profile);
await FactorioAPI.queryMods();
let mods = FactorioAPI.getMods([
"boblogistics",
"rso-mod",
"clusterio"
]);
await FactorioAPI.downloadLatestReleases(mods);
await FactorioAPI.checkUpdates(mods);
let installedReleases = await profile.getInstalledReleases();
for (let rel of installedReleases) {
await FactorioAPI.downloadDependencies(rel, false);
}
await profile.loadModlist();
profile.installedReleases.forEach(rel => {
rel.enabled = true
});
await profile.saveModlist();
let saveReleases = await FactorioAPI.getModsFromSaveFile("test.zip");
await FactorioAPI.downloadReleases(saveReleases);
})();
Documentation [Outdated! Coming soon...]
Documentation
Useful information