How to use vow-fs - 10 common examples

To help you get started, we’ve selected a few vow-fs 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 / bh / techs / bh-client-module.js View on Github external
Vow.all(bhFiles.map(function(file) {
                return vowFs.read(file.fullname, 'utf8').then(function(data) {
                    var relPath = node.relativePath(file.fullname);
                    return '// begin: ' + relPath + '\n' +
                        bhClientProcessor.process(data) + '\n' +
                        '// end: ' + relPath + '\n';
                });
            })).then(function(sr) {
                return sr.join('\n');
github MrKashlakov / enb-transform-flow / techs / transform-flow.js View on Github external
return fileCache.get(file.fullname, file.mtime).then(function (codeFromCache) {

					// Если кэш пуст, то читаем исходный файл
					if (codeFromCache === null) {
						return vowFs.read(file.fullname).then(function (codeFromFile) {
							// Явно приводим трансформаторы к массиву
							var transformators = [].concat(_this._transformators);

							// Так как, трансформаторы могут быть промисами, то работаем через промисы
							var firstPromise = vow.resolve(codeFromFile);

							// Запускаем последовательое преоброазоваение каждым трансформатором
							var resultPromise = _.reduce(transformators, function (promise, transformator) {
								return promise.then(function (result) {
									if (Buffer.isBuffer(result)) {
										result = result.toString();
									}
									return transformator(result, jobQueue);
								});
							}, firstPromise);
github enb / enb / techs / js-uglify.js View on Github external
process: function(sourcePath, targetPath) {
        return vowFs.read(sourcePath, 'utf8').then(function(data) {
            return vowFs.write(targetPath, uglifyJs(data), 'utf8');
        });
    }
});
github enb / enb / techs / csso.js View on Github external
process: function(sourcePath, targetPath, preserveStructure) {
        return vowFs.read(sourcePath, 'utf8').then(function(data) {
            data = csso.justDoIt(data, preserveStructure);
            return vowFs.write(targetPath, data, 'utf8');
        });
    }
});
github jscs-dev / node-jscs / lib / checker.js View on Github external
Checker.prototype.checkFile = function(path) {
    if (this._configuration.isFileExcluded(path)) {
        return Vow.resolve(null);
    }

    return vowFs.read(path, 'utf8').then(function(data) {
        return this.checkString(data, path);
    }, this);
};
github belyanskii / bem-ide / server / bem-ide-toolkit / index.js View on Github external
return fs.exists(entityPath).then(function(exists) {
            if(exists) {
                return fs.read(entityPath, 'utf-8').then(function(data) {
                    return {
                        tech: data,
                        level: entityPath
                    };
                });
            } else {
                return {
                    tech: 'WRITE SOME CODE FOR THIS LEVEL HERE',
                    level: entityPath
                };
            }
        });
    }, this))
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-archive / bem-site-engine / src / data / providers / provider-file.js View on Github external
this.load = function (options) {
        logger.debug(util.format('load data from file %s', options.path), module);
        return vowFs.read(options.path, 'utf-8');
    };
github es-analysis / plato-as-service / lib / report.js View on Github external
.then(function () {
                return vowFs.read(reportFile);
            })
            .then(function (json) {
github bem / html-differ / lib / cli.js View on Github external
.act(function (opts, args) {
        return vow.all([
            vfs.read(path.resolve(args.path1), 'utf-8'),
            vfs.read(path.resolve(args.path2), 'utf-8'),
            opts.config ? vfs.read(path.resolve(opts.config)) : undefined
        ]).spread(function (html1, html2, config) {
            config = config ? JSON.parse(config) : {};

            if (opts.preset) {
                config.preset = opts.preset;
            }

            var options = defaults(config),
                loggerOptions = {
                    charsAroundDiff: opts.charsAroundDiff
                },
                htmlDiffer = new HtmlDiffer(options);

            diffLogger.logDiffText(htmlDiffer.diffHtml(html1, html2), loggerOptions);

vow-fs

File I/O by Vow

MIT
Latest version published 8 years ago

Package Health Score

41 / 100
Full package analysis

Popular vow-fs functions