Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lajbel/newgrounds-js
🌆 The definitive library for connecting your games to Newgrounds
https://github.com/lajbel/newgrounds-js
api gamedev newgrounds newgroundsio
Last synced: about 2 months ago
JSON representation
🌆 The definitive library for connecting your games to Newgrounds
- Host: GitHub
- URL: https://github.com/lajbel/newgrounds-js
- Owner: lajbel
- Created: 2021-10-07T21:07:43.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-02T22:06:09.000Z (2 months ago)
- Last Synced: 2024-09-08T09:17:51.068Z (2 months ago)
- Topics: api, gamedev, newgrounds, newgroundsio
- Language: TypeScript
- Homepage: https://newgrounds.lajbel.com
- Size: 5.6 MB
- Stars: 13
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
![ngjsbanner](assets/newgrounds.js.png)
Newgrounds.js is the definitive library for connecting your game to the Newgrounds.io API.
## Features 🎁
- 🚀 Intuitive usage
- 📖 Full documented with guides and examples.
- 🌟 You can use the wrapper functions `unlockMedal()` or make your own requests with `call("Medal.unlock")`
- 📦 Async/Await by default
- 📜 Full Typescript support
- 🍜 ESM and CommonJS support## Installation 📦
You can install the package using your favorite node package manager.
```bash
npm i newgrounds.js
```Also can use the CDN to include the library in your project.
```html
```
## Example 📝
```js
import ng from "newgrounds.js";// Connect to your project
await ng.connect("533327:b6GaR8Eb", "ivuwzsfewkqñwacRQ==");// Request user login
await ng.login();// Start using NG.io
await ng.unlockMedal(129521);
await ng.postScore(12052012, 50);
```## Credits 🙏
- [Newgrounds.io](https://newgrounds.io) API
- [Javascript Wrapper](https://github.com/KilledByAPixel/newgrounds) by [KilledByAPixel](https://github.com/KilledByAPixel), used as the base for this library.
- [niceEli](https://www.github.com/niceEli/), for making the Newgrounds song loader.