icmodsapi
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

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.

Package Sidebar

Install

npm i icmodsapi

Weekly Downloads

4

Version

1.1.2

License

MIT

Unpacked Size

21.1 kB

Total Files

19

Last publish

Collaborators

  • 80lk