Giter VIP home page Giter VIP logo

node-osu's Introduction

osu! Standard Library

This library aims to be an all-in-one library for developing osu! related applications using Javascript/Node.js. Here is a list of its current features (checked) and planned features (unchecked). Drop an issue if there's something you want to see in this list!

  • osu! API driver
  • Beatmap parser
  • Built-in implementation of oppai
  • Mapset utils

Getting Started

To install this package, run the following command in the root directory of your project:

npm install --save osu

You're ready to use this package! Check out the documentation (coming soon) for guides and an API reference.

Using the osu! API

Replace the xxxxx below with your osu! API key. You can find your osu! API key at https://osu.ppy.sh/p/api.

// replace xxxxx with your API key
const api = require("osu").api("xxxxx");

Now you can call any API function you'd like. Here is an example of retrieving the infamous beatmap for FREEDOM DiVE.

api.getBeatmaps({
    "s": 39804,
    "limit": 1
}).then(function(result) {
    console.log(result);
);

This class employs Promises to handle asynchronous execution. This means the object returned by api.getBeatmaps is not the actual beatmap information you were looking for, but a Promise object that will execute independently of the current program. This is why the callback function that takes in the result object is necessary. To read more about Promises, read this helpful introduction from the MDN reference.

Contact

Author: IOException

License: MIT

Email: [email protected]

node-osu's People

Contributors

iptq avatar ioexceptionosu avatar

Stargazers

Moni avatar lictex_ avatar luojia avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

node-osu's Issues

Error: Cannot find module '../constants'

Full error :

C:\Users\admin\Desktop\xxxxx>node .
internal/modules/cjs/loader.js:1023
  throw err;
  ^

Error: Cannot find module '../constants'
Require stack:
- C:\Users\admin\Desktop\xxxxx\node_modules\osu\dist\math\spline.js
- C:\Users\admin\Desktop\xxxxx\node_modules\osu\dist\beatmap\hitObject.js
- C:\Users\admin\Desktop\xxxxx\node_modules\osu\dist\beatmap\index.js
- C:\Users\admin\Desktop\xxxxx\node_modules\osu\dist\index.js
- C:\Users\admin\Desktop\xxxxx\commands\osu.js
- C:\Users\admin\Desktop\xxxxx\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\admin\Desktop\xxxxx\node_modules\osu\dist\math\spline.js:5:19)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\admin\\Desktop\\xxxxxxxxxx\\node_modules\\osu\\dist\\math\\spline.js',
    'C:\\Users\\admin\\Desktop\\xxxxxxxxxx\\node_modules\\osu\\dist\\beatmap\\hitObject.js',
    'C:\\Users\\admin\\Desktop\\xxxxxxxxxx\\node_modules\\osu\\dist\\beatmap\\index.js',
    'C:\\Users\\admin\\Desktop\\xxxxxxxxxx\\node_modules\\osu\\dist\\index.js',
    'C:\\Users\\admin\\Desktop\\xxxxxxxxxx\\commands\\osu.js',
    'C:\\Users\\admin\\Desktop\\xxxxxxxxxx\\index.js'
  ]
}

Tried with npm i osu & npm install --save osu and none of them worked, pls help q-q

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.