How to use thenify-all - 10 common examples

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 qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / mz / fs.js View on Github external
'rename',
    'rmdir',
    'stat',
    'symlink',
    'truncate',
    'unlink',
    'utimes',
    'write',
    'writeFile'
]

typeof fs.access === 'function' && api.push('access')
typeof fs.copyFile === 'function' && api.push('copyFile')
typeof fs.mkdtemp === 'function' && api.push('mkdtemp')

require('thenify-all').withCallback(fs, exports, api)

exports.exists = function (filename, callback) {
    // callback
    if (typeof callback === 'function') {
        return fs.stat(filename, function (err) {
            callback(null, !err);
        })
    }
    // or promise
    return new Promise(function (resolve) {
        fs.stat(filename, function (err) {
            resolve(!err)
        })
    })
}
github ncb000gt / node-es / lib / cluster.js View on Github external
};

	// http://www.elasticsearch.org/guide/reference/api/admin-cluster-update-settings/
	self.updateSettings = function (options, data, callback) {
		if (!callback && typeof data === 'function') {
			callback = data;
			data = options;
			options = {};
		}

		options.pathname = utils.pathAppend('_cluster/settings');

		return req.put(options, data, callback);
	};

	return thenifyAll.withCallback(self, {});
};
github kevinbeaty / fs-promise / index.js View on Github external
'outputFile',
  'outputJson',
  'readJson',
  'remove',
  'writeJson',
  // aliases
  'createFile',
  'createLink',
  'createSymlink',
  'emptydir',
  'mkdirp',
  'readJSON',
  'outputJSON',
  'writeJSON'
]
thenifyAll.withCallback(fsExtra, exports, fsExtraKeys)

// Delegate all normal fs to mz/fs
// (this overwrites anything proxies directly above)
var mzKeys = [
  'rename',
  'ftruncate',
  'chown',
  'fchown',
  'lchown',
  'chmod',
  'fchmod',
  'stat',
  'lstat',
  'fstat',
  'link',
  'symlink',
github normalize / mz / child_process.js View on Github external
require('thenify-all').withCallback(
  require('child_process'),
  exports, [
    'exec',
    'execFile',
  ]
)
github normalize / mz / crypto.js View on Github external
require('thenify-all').withCallback(
  require('crypto'),
  exports, [
    'pbkdf2',
    'pseudoRandomBytes',
    'randomBytes'
  ]
)
github qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / mz / crypto.js View on Github external
require('thenify-all').withCallback(
    require('crypto'),
    exports, [
        'pbkdf2',
        'pseudoRandomBytes',
        'randomBytes'
    ]
)
github qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / mz / child_process.js View on Github external
require('thenify-all').withCallback(
    require('child_process'),
    exports, [
        'exec',
        'execFile',
    ]
)
github normalize / mz / dns.js View on Github external
require('thenify-all').withCallback(
  require('dns'),
  exports, [
    'lookup',
    'resolve',
    'resolve4',
    'resolve6',
    'resolveCname',
    'resolveMx',
    'resolveNs',
    'resolveSrv',
    'resolveTxt',
    'reverse'
  ]
)
github normalize / mz / zlib.js View on Github external
require('thenify-all').withCallback(
  require('zlib'),
  exports, [
    'deflate',
    'deflateRaw',
    'gzip',
    'gunzip',
    'inflate',
    'inflateRaw',
    'unzip',
  ]
)
github qiushi123 / xiaochengxu_demos / 014云开发实现小程序支付 / cloud / pay / node_modules / mz / dns.js View on Github external
require('thenify-all').withCallback(
    require('dns'),
    exports, [
        'lookup',
        'resolve',
        'resolve4',
        'resolve6',
        'resolveCname',
        'resolveMx',
        'resolveNs',
        'resolveSrv',
        'resolveTxt',
        'reverse'
    ]
)

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