22
33[ ![ CI] [ b-build ]] [ x-actions ]
44
5- Simple REPL for gulp compatible with gulp 3.x and gulp 4.x .
5+ Simple REPL for gulp.
66
77### usage
88
9- ``` js
10- // gulpfile example
11- var gulp = require ( ' gulp' ) ;
12- var repl = require ( ' gulp-repl' ) ;
9+ ``` ts
10+ // gulpfile.ts
11+ import gulp from ' gulp' ;
12+ import repl from ' gulp-repl' ;
1313
14- gulp .task (' repl-start' , function (cb ) {
14+ gulp .task (' repl-start' , (cb ) => {
1515 gulp .repl = repl .start (gulp );
16+ cb ();
1617});
1718
18- gulp .task (' repl-stop' , function (cb ) {
19+ gulp .task (' repl-stop' , (cb ) => {
1920 if (gulp .repl ) {
2021 gulp .repl .close (); // same as nodejs.org/api/readline.html#readline_rl_close
2122 }
2223 cb ();
2324});
2425
25- gulp .task (' foo' , function (cb ) {
26+ gulp .task (' foo' , (cb ) => {
2627 // do foo stuff
2728 cb ();
2829});
2930
30- gulp .task (' bar' , function (cb ) {
31+ gulp .task (' bar' , (cb ) => {
3132 // do bar stuff
3233 cb ();
3334});
3435
35- gulp .task (' default' );
36+ gulp .task (' default' , gulp . series ( ' foo ' , ' bar ' ) );
3637```
3738
39+ > ** Note:** For ` gulpfile.ts ` , ensure ` ts-node ` or ` tsx ` is available. Use ` gulpfile.js ` with ` require() ` if you prefer plain JavaScript.
40+
3841Then, on your terminal write:
3942
4043```
@@ -64,38 +67,38 @@ foo bar default
6467
6568The module exports an object with the following methods:
6669
67- ``` js
68- var repl = require ( ' gulp-repl' ) ;
70+ ``` ts
71+ import repl from ' gulp-repl' ;
6972```
7073
7174#### repl.add
7275
73- ``` js
74- function add (Gulp gulp )
76+ ``` ts
77+ add (gulp : Gulp ): typeof repl
7578```
7679
7780Adds the ` gulp ` instance tasks for the REPL and _ returns_ the module again.
7881
7982#### repl.remove
8083
81- ```js
82- function remove(Gulp gulp)
84+ ``` ts
85+ remove (gulp : Gulp ): typeof repl
8386```
8487
8588Removes the ` gulp ` instance tasks from the REPL and _ returns_ the module again.
8689
8790#### repl.reset
8891
89- ```js
90- function reset()
92+ ``` ts
93+ reset (): typeof repl
9194```
9295
9396Removes all of the previously added instances and _ returns_ the module again.
9497
9598#### repl.get
9699
97- ```js
98- function get(Gulp gulp)
100+ ``` ts
101+ get (gulp ?: Gulp ): ReplInstance [] | ReplInstance | null
99102```
100103
101104Takes a ` gulp ` instance as argument.
@@ -107,8 +110,8 @@ _returns_
107110
108111#### repl.start
109112
110- ```js
111- function start(Gulp gulp)
113+ ``` ts
114+ start (gulp ?: Gulp ): readline . Interface
112115```
113116
114117Takes a ` gulp ` instance as argument.
0 commit comments