How to use the vow.all function in vow

To help you get started, we’ve selected a few vow 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 bem-site / bem-forum / server / old / model_old.js View on Github external
initArchives: function (options) {
        var _this = this;

        return vow.all(options.languages
            .filter(function (lang) {
                return options.archive[lang];
            })
            .map(function (lang) {
                var archive = new Archive(options, lang);

                _this.archive[lang] = archive;
                return archive.init();
            }));
    },
github apsavin / bnsf / .bem / techs / vanilla.js.js View on Github external
_readYmlFileAndReplacePlaceholders: function (output, suffix, contentWrapper) {
        var path = output + suffix;
        return Vow.all([this._getConfig(output), this._readFile(path)])
            .spread(function (config, content) {
                for (var key in config) {
                    if (config.hasOwnProperty(key)) {
                        content = content.replace(new RegExp('%' + key + '%', 'g'), config[key]);
                    }
                }
                return {
                    path: path.replace('yml', 'js'),
                    content: contentWrapper.call(this, yml.safeLoad(content))
                };
            }, this);
    },
github bem-archive / bem-site-engine / src / scripts / data_compiler / index.js View on Github external
.spread(function(obj, docs, libraries, people) {
                return vow
                    .all([
                        addDynamicNodes(obj.sitemap, obj.routes, docs, people),
                        addLibraryNodes(obj.sitemap, obj.routes, obj.libraryNodes, libraries)
                    ]).spread(function(dynamic, libraries) {
                        return {
                            sitemap: removeCircularReferences(obj.sitemap),
                            routes: obj.routes,
                            docs: docs,
                            urls: dynamic,
                            people: people
                        };
                    });
            })
            .then(function(content) {
github bem-archive / bem-site-engine / src / cluster / updater.js View on Github external
removeFiles: function() {
                return vow.all([
                    providers.getProviderFile().exists({ path: dataTargetPath }),
                    providers.getProviderFile().exists({ path: sitemapTargetPath })
                ]).spread(function(dataExists, sitemapExists) {
                    var promises = [];
                    if(dataExists) {
                        promises.push(providers.getProviderFile().remove({ path: dataTargetPath }));
                    }
                    if(sitemapExists) {
                        promises.push(providers.getProviderFile().remove({ path: sitemapTargetPath }));
                    }
                    return vow.all(promises);
                });
            },
github bemhint / bemhint / lib / bemhint.js View on Github external
module.exports = function (targets, loadedConfig) {
    var config = new Configuration(loadedConfig);

    return vow.all([scan(targets, config), loadRules()])
        .spread(function (entities, rules) {
            return vow.all(Object.keys(rules).map(function (rule) {
                return new rules[rule]().check(entities);
            }));
        })
        .then(function (res) {
            return _(res)
                .flatten()
                .sortBy('path')
                .value();
        });
};
github bem-archive / bem-site-engine / src / blocks / server.blocks / middleware / __error / middleware__error.node.js View on Github external
return vow.all(langs.map(function (lang) {
            return vow.all([
                vowFs.read(path.join(errorBundlesPath, 'error-404', 'error-404.' + lang + '.html'), 'utf-8'),
                vowFs.read(path.join(errorBundlesPath, 'error-500', 'error-500.' + lang + '.html'), 'utf-8')
            ]).spread(function (error404, error500) {
                errorPages[lang] = {
                    error404: error404.replace(/\{STATICS_HOST\}/g, staticsUrl),
                    error500: error500.replace(/\{STATICS_HOST\}/g, staticsUrl)
                };
            });
        }))
        .then(function () {
github bem-sdk-archive / bem-walk / benchmark / enb.js View on Github external
function run(levels, plain, done) {
    vow.all(levels.map(function (level) {
        return (new Level(level, plain)).load();
    })).then(done, done);
}
github enb / enb / techs / priv-js-i18n-all.js View on Github external
.builder(function (langFilenames, privJs) {
        return Vow.all(
            langFilenames.map(function (filename) {
                return vowFs.read(filename);
            })
        ).then(function (langResults) {
            return langResults.join('\n') + privJs;
        });
    })
    .createTech();
github enb / enb / techs / levels.js View on Github external
.then(function () {
                return Vow.all(levelList.map(function (level) {
                        return level.load();
                    }))
                    .then(function () {
                        levelsToCache.forEach(function (level) {
                            cache.set(level.getPath(), level.getBlocks());
                        });
                        _this.node.resolveTarget(target, new Levels(levelList));
                    });
            });
    },
github bem-archive / bem-site-engine / src / scripts / data_compiler / tasks / load_libraries.js View on Github external
run: function(libraryNodes) {
        logger.info(MSG.INFO.START);

        var libraries = {};
        return vow
            .all(libraryNodes.map(function(node) {
                return loadLibraryVersions(config.get('github:librariesRepository'), node, libraries);
            }))
            .then(
                function() {
                    logger.info(MSG.INFO.SUCCESS);
                    return libraries;
                },
                function() { logger.error(MSG.ERROR); }
            );
    }
};

vow

DOM Promise and Promises/A+ implementation for Node.js and browsers

MIT
Latest version published 5 years ago

Package Health Score

53 / 100
Full package analysis

Popular vow functions