How to use after - 10 common examples

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 / ncore / modules / dependencyMapper.js View on Github external
map: function (options, callback) {
        options = extend({}, DEPENDENCY_WRITE_DEFAULTS, options)
        var json = require(options.jsonUri)

        // the JSON DSL has the option to have "/foo" in 
        after.reduce(json, createFoldersIntoFilesIterator(options.uri), 
            {}, runDependencyMapper)

        function runDependencyMapper(err, data) {
            if (err) {
                return callback(err)
            }
            after.map(data, mapToDependencies, callback)
        }

        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
github cult-of-coders / redis-oplog / testing / collection_hooks.server.js View on Github external
Collection.after.insert(function () {
                updates['after.insert'] = true;
            });
            Collection.before.update(function () {
github cult-of-coders / redis-oplog / testing / collection_hooks.server.js View on Github external
Collection.after.remove(function () {
                updates['after.remove'] = true;
            });
github cult-of-coders / redis-oplog / testing / collection_hooks.server.js View on Github external
Collection.after.update(function () {
                updates['after.update'] = true;
            });
            Collection.before.remove(function () {
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 / dependencyWriter.js View on Github external
optionallyReadFolder: function optionallyReadFolder(err, stats) {
        if (err) {
            return this.callback(err)
        }
        if (stats.isFile()) {
            this.relative = makeRelative.call(this)
            this.emitter.emit("dependencySet", this.relative, this.uri)
            after.forEach(this.depObject, this.injectDependency, 
                this, this.callback)
        } else if (stats.isDirectory()) {
            fs.readdir(this.uri, this.writeFileDependencies)
        }
    },
    writeFileDependencies: function readFiles(err, files) {
github Raynos / ncore / modules / dependencyMapper.js View on Github external
function runDependencyMapper(err, data) {
            if (err) {
                return callback(err)
            }
            after.map(data, mapToDependencies, callback)
        }
github Raynos / ncore / modules / dependencyWriter.js View on Github external
writeFileDependencies: function readFiles(err, files) {
        if (err) {
            return this.callback(err)
        }
        after.forEach(files, writeDependency, this, this.callback)

        function writeDependency(fileName, done) {
            DependencyWriter({
                uri: path.join(this.uri, fileName),
                depObject: this.depObject,
                originalUri: this.originalUri,
                core: this.core,
                emitter: this.emitter,
                callback: done
            })
        }
    },
    injectDependency: function injectDependency(pattern, name, callback) {
github wei / new-issue / src / helper / gh-helper.js View on Github external
const buildIssueBody = (bodyOutputs = [], config) => {
  const bodyStrings = []
  const { output = {} } = config || {}
  const beforeMD = output['before.md'] || ''
  const afterMD = output['after.md'] || '\n\n'

  if (beforeMD) bodyStrings.push(beforeMD)
  bodyOutputs.forEach(({ label, value }) => {
    if (value) {
      bodyStrings.push(`${label || ''}${value}`)
    } else if (label && !value && !output.hideEmpty) {
      bodyStrings.push(`${label}`)
    }
  })
  if (afterMD) bodyStrings.push(afterMD)
  return bodyStrings.join('\n\n')
}

after

after - tiny flow control

MIT
Latest version published 8 years ago

Package Health Score

71 / 100
Full package analysis