npm.io
0.0.5 • Published 8 years ago

picotube

Licence
GPLv3.0
Version
0.0.5
Deps
1
Size
134 kB
Vulns
24
Weekly
0

PicoTube: a tiny Youtube API library with promises

install

just run yarn add picotube

usage

we map exactly to the youtube API REST names, note that we only implement the list behaviour https://developers.google.com/youtube/v3/docs/

so to use the videos endpoint simply do

    import PicoTube from 'picotube'

    const pico = new PicoTube(API_KEY)
    pico.videos({
      id: 'QcQIaoHajoM'
    }).then(res => res.data)
      .then(info => {
        console.log('hello mom, i got this from youtube', info)
    })

note that we return the raw axios object, so errors live in response.data.error