80LK / ICModsAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ICModsAPI

license npm downloads npm version

Simple Node.js module that allows you to interact with the ICMods API.

Installation

npm i --save icmodsapi

Usage API

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" });

License(MIT)

See the LICENSE file for details.

About

License:MIT License


Languages

Language:TypeScript 100.0%