2017-04-21 1 views
1

私はVSコードテストを分析しています。.once(文字列、関数)は何をしますか?

'use strict'; 

const gulp = require('gulp'); 
const mocha = require('gulp-mocha'); 

gulp.task('test', function() { 
    return gulp.src('test/all.js') 
     .pipe(mocha({ ui: 'tdd', delay: true })) 
     .once('end', function() { process.exit(); }); 
}); 

once(string, function)の文書は見つかりませんでした。それは何をするためのものか?ドキュメントはどこですか?

Having searched the gulp sourceは、1回の定義の使用ではなく、1回の定義を示しています。

答えて

2

once()は、Node.jsの機能/機能で、Gulpではありません。

Here's the documentation

Streamsでは、1回追加するために使用できます。listenereventがトリガーされると、listenerが呼び出されて削除されます。

関連する問題