Simple Node.js module that allows you to interact with the ICMods API.
npm i --save icmodsapi
Get full description for mod
import ICModsAPI from 'icmodsapi';
(async () => {
const mod = await ICModsAPI.getModInfo(22);
// or ICModsAPI.description
console.log(mod);
})();
Get List Mods
const mods = await ICModsAPI.list(ICModsAPI.Sort.POPULAR, 0, 20);
console.log(mods);
const mods = await ICModsAPI.listForIds([22, 299]);
console.log(mods);
Search mods
const mods = await ICModsAPI.searchMods("industrial");
console.log(mods);
const mods = await ICModsAPI.searchModsAtTag("global");
console.log(mods);
const mods = await ICModsAPI.searchModsFromAuthor(2);
console.log(mods);
Get Image
import { writeFileSync } from "fs";
//...
const mod = await ICModsAPI.getModInfo(22);
writeFileSync("fileName.png", await ICModsAPI.getImage(mod.icon), { encoding: "binary" });
See the LICENSE file for details.