A zero-dependencies NodeJS package to interact with the curseforge core api. Requires a CFCore authentication token (get one from console.curseforge.com/#/api-keys and yes you need to use a google account to login (sadly)).
view on npm: node-curseforge
To install this package you can use either yarn or npm.
yarn add node-curseforge
or
npm install node-curseforge
You can use this package mostly in two ways. Either you fetch a game first and interact over the game mostly with the api or you use the root class and give the required ids or objects directly.
const {Curseforge} = require("node-curseforge");
let cf = new Curseforge(cf_token);
let mc = cf.get_game("minecraft");
cf.search_mods(mc).then((mods) => {
for(let mod of mods){
cf.get_description(mod).then((desc) => {
console.log(desc);
});
}
});
Using the methods on the objects themselves actually calls them using the curseforge instance and directly fills in the ids.
const {Curseforge} = require("node-curseforge")
let cf = new Curseforge(cf_token);
let mc = cf.get_game("minecraft");
mc.search_mods().then((mods) => {
for(let mod of mods){
mod.get_description().then((desc) => {
console.log(desc);
})
}
})
The entire package is written in typescript and compiled to Javascript with an additional declaration file! You can therefore use this file with regular Javascript or with regular Typescript.
You can find the (wip) documentation at mondanzo.github.io/node-curseforge. Most of the code is very self-explanatory though and overall also 1:1 identical with the CFCore Docs.