@b1tt/ng-fetch

Lightweight package for fetching data from Newgrounds.

Usage no npm install needed!

<script type="module">
  import b1ttNgFetch from 'https://cdn.skypack.dev/@b1tt/ng-fetch';
</script>

README

npm (scoped) npm bundle size (scoped) GitHub last commit

ng-fetch

ng-fetch is a lightweight and fast Newgrounds wrapper.

You can use it by writing const ng = require("@b1tt/ng-fetch"); // Const name can be changed preferably.

With ng-fetch, you can:

  • Songs
    • Fetch songs
    • Search songs
  • Fetch users
  • Browse the frontpage
  • Art
    • Fetch art
    • Search art
  • Portal
    • Games
      • Search games
    • Movies
      • Search movies
    • Fetch games / movies

And even more on the way! All that is returned in a nice JSON object.

Song fetching

// const song = ng.song.fetch(id)
const song = ng.song.fetch(1); // Fetches songs with tag / name "b1tt"
  .then (data => console.log(data)); // and logs it into the console!
// It has to be promise so it won't return { Promise <Pending> }.

// Head over to /commands/song/fetch.js to see what it returns!

User fetching

// const user = ng.user.fetch(username)
const user = ng.user.fetch("bitt0"); // Fetches my profile :^)
  .then (data => console.log(data)); // and logs it into the console!

// Head over to /commands/users/fetch.js to see what it returns!

If you want to see more commands and what they return - go to /commands/