How to use the q.ninvoke function in q

To help you get started, we’ve selected a few q 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 MobileChromeApps / mobile-chrome-apps / src / create-app.js View on Github external
.then(function() {
    if (!appWasImported) {
      // Update app name if the app is not imported.
      return Q.ninvoke(fs, 'readFile', manifestDesktopFilename, { encoding: 'utf-8' }).then(function(manifestDesktopData) {
        var manifestDesktop;
        try {
          // jshint evil:true
          manifestDesktop = eval('(' + manifestDesktopData + ')');
          // jshint evil:false
        } catch (e) {
          console.error(e);
          return Q.reject('Unable to parse manifest ' + manifestDesktopFilename);
        }
        manifestDesktop.name = appName || path.basename(destAppDir);
        manifest.name = manifestDesktop.name;
        Q.ninvoke(fs, 'writeFile', manifestDesktopFilename, JSON.stringify(manifestDesktop, null, 4));
      });
    }
  })
  .then(function() {
github apache / cordova-lib / cordova-lib / src / util / npm-helper.js View on Github external
function () {
                // Invoke NPM Cache Add
                return Q.ninvoke(npm.commands, 'cache', ['add', (packageName + '@' + packageVersion)]).then(
                    function (info) {
                        var packageDir = path.resolve(npm.cache, info.name, info.version, 'package');
                        var packageTGZ = path.resolve(npm.cache, info.name, info.version, 'package.tgz');

                        return unpack.unpackTgz(packageTGZ, packageDir);
                    }
                );
            }
        );
github dundalek / warehouse / backend / nedb.js View on Github external
return this.collection().then(function(collection) {
            return Q.ninvoke(collection, 'update', selector, object, {})
                    .then(function(result) {
                        return object;
                    });
        });
    },
github jsha / blocktogether / actions.js View on Github external
function doBlock(sourceBtUser, sinkUid) {
  return Q.ninvoke(twitter, 'blocks', 'create', {
      user_id: sinkUid,
      skip_status: 1
    }, sourceBtUser.access_token, sourceBtUser.access_token_secret)
    .spread(function(result, response) {
      logger.trace('/blocks/create', sourceBtUser, sinkUid,
        response.statusCode);
      return result;
    });
}
github Pouja / jira-terminal / src / plugins / Filter.js View on Github external
.then(function(favourites) {
                var issue = _.find(favourites, {
                    id: filterId
                });
                if (!issue) {
                    throw NodeUtil.format('Could not find any filter with id: %s.', filterId);
                } else {
                    return Q.ninvoke(jiraApi, 'requestRef', issue.searchUrl);
                }
            })
            .then(function(issues) {
github mathisonian / autopages / lib / processor.js View on Github external
.then(function() {
                return Q.ninvoke(self.repo, 'add', self.repo.path + '/*');
            })
            .then(function() {
github relax / relax / lib / server / routers / api / media.js View on Github external
.then(() => {
      return Q.ninvoke(fs, 'rename', file.path, absoluteUrl);
    })
    .then(() => {
github pwa-builder / pwabuilder-lib / lib / projectBuilder.js View on Github external
return fileTools.mkdirp(generatedAppOutputDir).then(function() {
            var w3cManifestInfoCopy = JSON.parse(JSON.stringify(w3cManifestInfo));
            return Q.ninvoke(platform, 'create', w3cManifestInfoCopy, generatedAppOutputDir, options, href).then(function () {
              log.info('The ' + platform.name + ' app was created successfully!');
            })
            .catch(function (err) {
              return Q.reject(new CustomError('Failed to create the ' + platform.name + ' app.', err));
            });
          });
        });
github erizo-fr / erizo-webmail-api / lib / services / boxService.js View on Github external
module.exports.getBoxes = function * (connection) {
	logger.debug("Getting boxes")
	let boxes = yield Q.ninvoke(connection, "getBoxes")
	return boxes
}
github ankitpatial / mongodb-promises / lib / collection.js View on Github external
.then(function (coll) {
            return Q.ninvoke(coll, 'distinct', key, query, options);
        })
        .then(deferred.resolve)

q

A library for promises (CommonJS/Promises/A,B,D)

MIT
Latest version published 7 years ago

Package Health Score

63 / 100
Full package analysis