How to use the thenify-all.thenify function in thenify-all

To help you get started, we’ve selected a few thenify-all 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 larkjs / lark / lib / promisify.js View on Github external
*/

'use strict';

const thenifyAll = require('thenify-all');
const got = require('got');
const http = thenifyAll(got, {}, [
    'get',
    'post',
    'put',
    'patch',
    'head',
    'delete'
]);

exports.promisify = thenifyAll.thenify;
exports.promisifyAll = thenifyAll;
exports.http = http;
github sebinsua / neo4j-simple / src / database.js View on Github external
"use strict";

var Joi = require('joi');

var Neo4j = require('rainbird-neo4j');

var Promise = require('any-promise'),
    thenifyAll = require('thenify-all');

var thenify = thenifyAll.thenify;

var node = require('./node'),
    relationship = require('./relationship'),
    responseParser = require('./response-parser');

var sourceifyPromises = require('./sourceify-promises');
var tapifyPromises = require('./tapify-promises');

var decorateError = function decorateErrorWithName(error) {
  var errorMessage = error.message || '';
  var matches = /\(([^)]+)\)/.exec(errorMessage);
  var code = matches && matches.length ? matches[1] : undefined;
  switch (code) {
    case 'Neo.ClientError.Security.AuthenticationFailed':
    case 'Neo.ClientError.Security.AuthenticationRateLimit':
    case 'Neo.ClientError.Security.AuthorizationFailed':

thenify-all

Promisifies all the selected functions in an object

MIT
Latest version published 10 years ago

Package Health Score

71 / 100
Full package analysis