@hizollo/osu-api 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (C) 2022 HiZollo
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @hizollo/osu-api
2
+ [![npm version](https://img.shields.io/npm/v/@hizollo/osu-api.svg?maxAge=3600)](https://www.npmjs.com/package/@hizollo/osu-api)
3
+ [![Downloads](https://img.shields.io/npm/dt/@hizollo/osu-api.svg?maxAge=3600)](https://www.npmjs.com/package/@hizollo/osu-api)
4
+ [![Last Commit](https://img.shields.io/github/last-commit/HiZollo/osu-api)](https://github.com/HiZollo/osu-api)
5
+ [![Code Size](https://img.shields.io/github/languages/code-size/HiZollo/osu-api)](https://github.com/HiZollo/osu-api)
6
+ ![License](https://img.shields.io/github/license/HiZollo/osu-api)
7
+
8
+ ## About
9
+ This library is a node.js wrapper of [osu!api](https://osu.ppy.sh/wiki/en/osu!api) v1.
10
+
11
+ ## Documentation
12
+ You can look up the documentation [here](https://hizollo.github.io/osu-api).
13
+
14
+ ## Installation
15
+ ```
16
+ npm install @hizollo/osu-api
17
+ yarn add @hizollo/osu-api
18
+ ```
19
+
20
+ ## Examples
21
+ Import the package:
22
+ ```ts
23
+ // CommonJS
24
+ const { Client } = require('@hizollo/osu-api')
25
+
26
+ // ESM
27
+ import { Client } from '@hizollo/osu-api'
28
+ ```
29
+ Create a client to interact with [osu!api](https://osu.ppy.sh/wiki/en/osu!api):
30
+ ```ts
31
+ const osu = new Client({
32
+ apiKey: 'your-osu-api-key'
33
+ })
34
+ ```
35
+ Get a user's data:
36
+ ```ts
37
+ const user = await osu.users.getUser({
38
+ user: 'Cookiezi'
39
+ })
40
+ ```
41
+ Get a player's top 5 play:
42
+ ```ts
43
+ const bp = await osu.users.getUserBest({
44
+ user: '214187',
45
+ type: UserRequestType.Id,
46
+ mode: GameMode.Catch,
47
+ limit: 5
48
+ })
49
+ ```
50
+ Fetch a player's banner:
51
+ ```ts
52
+ // Fetch directly
53
+ const bannerURL = await osu.users.fetchBanner({
54
+ id: '7823498'
55
+ })
56
+
57
+ // ... or if you have the user object
58
+ const bannerURL = await user.fetchBanner();
59
+ ```
60
+
61
+ ## License
62
+ This package is published under the MIT license.