Skip to content

refactorinqq/ModrinthJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATTENTION: This is obviously not an official package; I am not affiliated with neither Rinth, Inc. nor the Modrinth Team.

Welcome to ModrinthJS 👋

Version Documentation Maintenance License: GNU GPL v3.0

A type safe Modrinth implementation.

Install

npm install modrinthjs
# or
yarn add modrinthjs

Basic Usage

import { ProjectsService } from 'modrinthjs'

async function main() {
    const project = await (await ProjectsService.searchProjects("Fabric API")).hits[0]

    console.log("Title: " + project.title)
    console.log("Description: " + project.description)
    console.log("Categories: " + project.categories?.map((cat) => cat.toUpperCase()))
    console.log("Downloads: " + format(project.downloads))
    console.log("Followers: " + format(project.follows))
}

function format(num) {
    return Intl.NumberFormat('en-US', {
        notation: "compact",
        maximumFractionDigits: 1
    }).format(num);
}

main()
[~] $ node example.js
Title: Fabric API
Description: Lightweight and modular API providing common hooks and intercompatibility measures utilized by mods using the Fabric toolchain.
Categories: FABRIC,LIBRARY
Downloads: 5.8M
Followers: 7.8K
[~] $

Author

👤 refactoring

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2024 refactoring.
This project is GNU GPL v3.0 licensed.


This README was generated with ❤️ by readme-md-generator

About

An implementation of the Modrinth API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •