How to use the map function from event-stream

Find comprehensive JavaScript event-stream.map code examples handpicked from public code repositorys.

95
96
97
98
99
100
101
102
103
104
        }

        this.emit('data', file);
});

const formatting = es.map(function (file, cb) {
        tsfmt
                .processString(file.path, file.contents.toString('utf8'), {
                        verify: false,
                        tsfmt: true,
fork icon869
star icon0
watch icon274

1
2
3
4
5
6
7
8
9
10
var Mingo = require('mingo')
var es = require('event-stream')

module.exports = function(opts) {
  var options = Object.assign({ idProperty: '_id' }, opts)
  var self = es.map(createOrUpdate)
  var data = []
  var idSeq = 0

  var mingoOpts = Object.freeze({ idKey: options.idProperty })
fork icon23
star icon142
watch icon8

7
8
9
10
11
12
13
14
15
16

var es = require('event-stream'),
    PluginError = require('plugin-error');

var stream = function(injectMethod) {
    return es.map(function(file, cb) {
        try {
            file.contents = new Buffer(injectMethod(String(file.contents)));
        } catch (err) {
            return cb(new PluginError('gulp-inject-string', err));
fork icon15
star icon39
watch icon5

+ 7 other calls in file

240
241
242
243
244
245
246
247
248
249
250
    fs.mkdirSync(dirname);
    // fs.mkdir(sampleOutputFolder + 'src', { recursive: true }, (err) => { if (err) throw err; });
}


// function copyExclude(files) {
//     return es.map(function(file, cb) {
//         if (files.indexOf(file.basename) >= 0) {
//             // log('+ share data ' + file.basename);
//             cb(null, file);
//         } else {
fork icon5
star icon7
watch icon35

+ 7 other calls in file

84
85
86
87
88
89
90
91
92

    // continue control flow to next element in the stream
    next(null, data);
  }
  // return configured stream
  return es.map(sync);
}

// check for last modified from in-memory data
fork icon0
star icon0
watch icon0