Class: Gtube

Gtube(search, options)

Class representing a YouTube instance.

Constructor

new Gtube(search, options)

Represents a YouTube instance
Parameters:
Name Type Description
search String Search string
options Options Options
Author:
Source:

Extends

  • events.EventEmitter

Methods

item() → {Item}

get item at index
Source:
Returns:
Type
Item

options() → {Options}

get current Options
Source:
Returns:
Type
Options

(async) process(newSearch, callback) → {Promise.<Boolean>}

this method searches the provided search string on Youtube for video results.
Parameters:
Name Type Default Description
newSearch Boolean true Defines if we are continuing search or starting a new one
callback object Callback when searching is done. Done assign this until you're absolutely sure what you're doing
Source:
Fires:
  • event:cleared
  • event:addedItem
Throws:
Error
Returns:
is search was successful or ended with error
Type
Promise.<Boolean>
get current search string
Source:
Returns:
Type
String

size() → {Number}

length of items
Source:
Returns:
Type
Number

Events

addedItem

A new item has been added
Properties:
Name Type Description
item Item
Source:

cleared

Indicates that all items have been cleared
Source: