@youri-kane/heroku-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.17 • Public • Published

heroku-client

heroku developer api client with typescript support

TODO

  • handle heroku cache
  • handle lists
  • handle Rate-limit
  • handle metrics requests

createClient

    import { createClient } from '@youri-kane/heroku-client';

    const client = createClient({
        token: AUTH_TOKEN, // will thro if missing
    });

Making Requests

    import { createClient } from '@youri-kane/heroku-client';

    const client = createClient({
        token: AUTH_TOKEN,
    });

    const apps = await client.getApps({}) // types as App[]

Making Poll Requests

    import { createClient, createPollRequest } from '@youri-kane/heroku-client';

    const client = createClient({
        token: AUTH_TOKEN,
    });

    /** */
    const emitter = await createPollRequest({}, client.getApps, 5000);

    emitter.on("data", (apps: App[]) => {
        console.log(apps)
    })

    emitter.on("error", (error: Error) => {
        console.error(error)
    })

    emitter.close();

Package Sidebar

Install

npm i @youri-kane/heroku-client

Weekly Downloads

0

Version

0.1.17

License

ISC

Unpacked Size

144 kB

Total Files

194

Last publish

Collaborators

  • youri-kane