How to use the after.map function in after

To help you get started, we’ve selected a few after 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 Raynos / ncore / modules / dependencyMapper.js View on Github external
function mapToDependencies(dependencies, moduleName, callback) {
            if (isFile.test(moduleName)) {
                // the JSON DSL has the option to have "/foo" or ["/foo"]
                // in .
                after.map(dependencies, createConvertToProxyNameIterator({
                    moduleName: moduleName,
                    uri: options.uri
                }), callback)
            }
        }
    }
github Raynos / DOM-shim / server.js View on Github external
http.createServer(function (req, res) {
	var features = JSON.parse(url.parse(req.url, true).query.features)

	var files = Object.keys(features).map(function (name) {
		var p = path.join.apply(path, name.split("."))
		p = path.join(".", "lib", p + ".js")
		return p
	})

	after.map(files, function (fileName, done) {
		path.exists(fileName, function (exists) {
			if (exists) {
				return done(null, fileName)
			} else {
				console.log("it does not exist", fileName)
			}
			done()
		})
	}, function (err, files) {
		var src = files
			.filter(function (it) { 
				return it !== undefined 
			})
			.map(function (it) {
				return "require('./" + it + "')"
			})
github Raynos / ncore / modules / dependencyMapper.js View on Github external
function runDependencyMapper(err, data) {
            if (err) {
                return callback(err)
            }
            after.map(data, mapToDependencies, callback)
        }

after

after - tiny flow control

MIT
Latest version published 8 years ago

Package Health Score

71 / 100
Full package analysis