How to use the any-promise.prototype function in any-promise

To help you get started, we’ve selected a few any-promise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sebinsua / neo4j-simple / src / database.js View on Github external
case 'Neo.ClientError.Security.AuthenticationFailed':
    case 'Neo.ClientError.Security.AuthenticationRateLimit':
    case 'Neo.ClientError.Security.AuthorizationFailed':
      error.name = 'Neo4jAuthError';
      break;
    default:
      error.name = 'Neo4jError';
      break;
  }

  throw error;
};

// This adds extra methods to the promises returned by Bluebird so that
// we can use these in place of `then()`.
sourceifyPromises(Promise.prototype, responseParser);

// This only does something in the case of ES6 Promises.
tapifyPromises(Promise.prototype);

// This create promise-returning versions of all of the standard
// node-style callback-returning methods.
Neo4j.prototype = thenifyAll(Neo4j.prototype);

module.exports = function (url, options) {
  options = options || {};
  options.idName = options.idName || 'id';
  url = url || "http://localhost:7474/";

  var hasCredentials = options.auth !== undefined;

  var client;
github sebinsua / neo4j-simple / src / database.js View on Github external
error.name = 'Neo4jAuthError';
      break;
    default:
      error.name = 'Neo4jError';
      break;
  }

  throw error;
};

// This adds extra methods to the promises returned by Bluebird so that
// we can use these in place of `then()`.
sourceifyPromises(Promise.prototype, responseParser);

// This only does something in the case of ES6 Promises.
tapifyPromises(Promise.prototype);

// This create promise-returning versions of all of the standard
// node-style callback-returning methods.
Neo4j.prototype = thenifyAll(Neo4j.prototype);

module.exports = function (url, options) {
  options = options || {};
  options.idName = options.idName || 'id';
  url = url || "http://localhost:7474/";

  var hasCredentials = options.auth !== undefined;

  var client;
  if (hasCredentials) {
    var username = options.auth.username;
    var password = options.auth.password;

any-promise

Resolve any installed ES6 compatible promise

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis