How to use the after.forEach 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 / 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 / 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) {

after

after - tiny flow control

MIT
Latest version published 8 years ago

Package Health Score

71 / 100
Full package analysis