npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

curse-api-js

v1.2.2

Published

A modern NodeJS library to easily retrieve informations using the CurseForge API

Downloads

17

Readme

Curse-API-JS

🚀 A modern NodeJS wrapper library to easily retrieve informations using the new CurseForge API. An equivalent to the Curse API, a PHP Library made by mTxServ.

Available on NPM here.

Please do not forget to star the project if you like/use it ⭐

Dependencies

  • Node >= 18

This library has been made to be lightweight and to not depend on any other package, for the best reliability. This way, you can safely use it for all of your projects without hassle.

Installation

npm install curse-api-js

Example

const { curseClient } = require("curse-api-js");

const curse = new curseClient()

curse.setToken(<your_api_key>) // https://console.curseforge.com/?#/api-keys

// Get the 30 most popular mods for Minecraft 1.19
curse.Minecraft.getMods('1.19')

Methods

CurseAPIJS will support all the games available on CurseForge. For now, only Minecraft is available so all the methods will use Minecraft as an example. Feel free to suggest what will be the next game!

// Sets your personal/team token to access CurseForge API, mandatory.
curse.setToken(<your_api_key>)

// Access the specified game methods, e.g Minecraft
curse.Minecraft

// Returns all the Minecraft versions with their corresponding ID to perform more complex operations afterwards
curse.Minecraft.getVersions()

/**
*   Returns mods for the specified version
*   {string} mandatory - version slug ("1.19" for example), only major versions
*   {int}    optional  - filter you wish to use among those enum values: https://docs.curseforge.com/?javascript#tocS_ModsSearchSortField
/
curse.Minecraft.getMods(<versionSlug>, <filter>)

// Not yet implemented
curse.Minecraft.getFeaturedMods()