function search(query) {
        // Return a promise
        return new Promise(function(resolve, reject) {
            // Search twitter
            twitter.get('search/tweets', query, function(err, data) {
                if(err) {
                    (reject)(err);
                } else {
                    (resolve)(data.statuses);
                }
            });
        });
    }
/**
     * Searches twitter and returns the result
     * @param query
     * @returns {Promise}
     */
Searches twitter and returns the result
@param query
@returns {Promise}
Searches twitter and returns the result @param query @returns { Promise }
function search(query) {
        return new Promise(function(resolve, reject) {
            twitter.get('search/tweets', query, function(err, data) {
                if(err) {
                    (reject)(err);
                } else {
                    (resolve)(data.statuses);
                }
            });
        });
    }
function search ( query ) { return new Promise ( function ( resolve , reject ) { twitter . get ( 'search/tweets' , query , function ( err , data ) { if ( err ) { ( reject ) ( err ) ; } else { ( resolve ) ( data . statuses ) ; } } ) ; } ) ; }
Searches twitter and returns the result
 @param query
 @returns {Promise}
Searches twitter and returns the result @param query @returns { Promise }
// Return a promise // Search twitter