0.0.4 • Published 1 year ago

rapidgatorv2 v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

rapidgatorv2

Note: This library has just started. Pull requests are welcomed!

JavaScript Node.js library for rapidgator's V2 API (rapidgator.net)

Installation

npm install rapidgatorv2

Usage

const { Rapidgator } = require('rapidgatorv2')

const username = 'myUsername'
const password = 'abc12345'

const rg = new Rapidgator()

rg.login(username, password)
  .then((loginResponse) => {
    // Token implicitly saved in internal client.
    // It is automatically re-used in future requests.
    return rg.getProfile().then((profileResponse) => {
      const { user } = profileResponse.response
      const { email, storage, traffic } = user

      console.log(`Current email: ${email}`)
      console.log(`Storage`, storage)
      console.log(`Traffic`, traffic)
    })
  })
  .catch((error) => {
    const err = error instanceof Error ? error : new Error(String(error))
    console.error(err)
  })

API

Start by requiring the client:

const { Rapidgator } = require('rapidgatorv2')

Read the full documentation API (Coming soon)

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago