index.js
function Feedsme(opts) {
  if (!this) new Feedsme(opts); // eslint-disable-line no-new

  if (typeof opts === 'string') {
    this.base = opts;
  } else if (opts.protocol && opts.href) {
    this.base = url.format(opts);
  } else if (opts.url || opts.uri) {
    this.base = opts.url || opts.uri;
  } else {
    throw new Error('Feedsme URL required');
  }

  this.version = (opts.version === '1' || opts.version === 'v1' || opts.version === 1) ? '' : 'v2';

  //
  // Handle all possible cases
  //
  this.base = typeof this.base === 'object'
    ? url.format(this.base)
    : this.base;

  this.agent = opts.agent;
  this.retry = opts.retry;
}
function Feedsme(opts) {
  if (!this) new Feedsme(opts); // eslint-disable-line no-new

  if (typeof opts === 'string') {
    this.base = opts;
  } else if (opts.protocol && opts.href) {
    this.base = url.format(opts);
  } else if (opts.url || opts.uri) {
    this.base = opts.url || opts.uri;
  } else {
    throw new Error('Feedsme URL required');
  }

  this.version = (opts.version === '1' || opts.version === 'v1' || opts.version === 1) ? '' : 'v2';

  //
  // Handle all possible cases
  //
  this.base = typeof this.base === 'object'
    ? url.format(this.base)
    : this.base;

  this.agent = opts.agent;
  this.retry = opts.retry;
}
function Feedsme ( opts ) { if ( ! this ) new Feedsme ( opts ) ; // eslint-disable-line no-new if ( typeof opts === 'string' ) { this . base = opts ; } else if ( opts . protocol && opts . href ) { this . base = url . format ( opts ) ; } else if ( opts . url || opts . uri ) { this . base = opts . url || opts . uri ; } else { throw new Error ( 'Feedsme URL required' ) ; } this . version = ( opts . version === '1' || opts . version === 'v1' || opts . version === 1 ) ? '' : 'v2' ; // // Handle all possible cases // this . base = typeof this . base === 'object' ? url . format ( this . base ) : this . base ; this . agent = opts . agent ; this . retry = opts . retry ; }
Feedsme API client.

@constructor
@param {Object|String} opts Options for root URL of feedsme service
@param {String} opts.url The root URL of the feedsme service
@param {String} opts.uri The root URL of the feedsme service
@param {String} opts.href The href for root URL of the feedsme service
@param {String} opts.protocol Protocol for root URL of the feedsme service
@param {String} opts.version Which feedsme api version to use (defaults to v2)
@public
Feedsme API client .