You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+28-24Lines changed: 28 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,11 @@ When you require the module
84
84
var Gulp =require('gulp-runtime');
85
85
```
86
86
87
-
you get a constructor with 2 static methods
87
+
you get a constructor
88
88
89
-
### Gulp.create
89
+
### Static methods
90
+
91
+
#### Gulp.create
90
92
91
93
```js
92
94
functioncreate(Objectoptions)
@@ -98,7 +100,7 @@ function create(Object options)
98
100
- `options.repl = false` no REPL by default
99
101
- `options.wait = false` tasks run in __parallel__ by default. Pass `wait: true` to run tasks in __series__
100
102
101
-
### Gulp.createClass
103
+
#### Gulp.createClass
102
104
103
105
```js
104
106
function createClass(Object mixin)
@@ -119,7 +121,9 @@ var Gulp = require('gulp-runtime').createClass({
119
121
})
120
122
```
121
123
122
-
### gulp.task
124
+
### Instance methods
125
+
126
+
#### gulp.task
123
127
124
128
`gulp.src`, `gulp.dest`, `gulp.watch` and `gulp.task` behave the same as described in the [`gulp` API documentation][gulp-api].
125
129
@@ -148,7 +152,7 @@ gulp.task('build:mode(-dev|-prod)', function (done){
148
152
149
153
The parameters are defined using [parth][parth]. There you will find more information about what qualifies as parameter and what not.
150
154
151
-
### gulp.start
155
+
####gulp.start
152
156
153
157
`gulp.start` can be used in two ways
154
158
@@ -208,25 +212,6 @@ gulp.task('default', function (done) {
208
212
});
209
213
```
210
214
211
-
## REPL
212
-
213
-
```js
214
-
var gulp =require('gulp-runtime').create({repl:true});
215
-
```
216
-
217
-
When an instance passes `repl: true` the process running will not stop but wait and have a REPL listening on `stdin`. This way you can run tasks in the same way you run commands on the terminal.
218
-
219
-
```js
220
-
node gulpfile.js
221
-
# some task logging here...
222
-
# when done press enter
223
-
> build less compress png
224
-
```
225
-
226
-
- If those tasks are defined they will run in __parallel__
227
-
- If there is more than one instance with `repl: true` the REPL will go through them and run the first task that matched one of those tasks
228
-
- If one or more of those tasks is not defined there will be a warning and none of the tasks will run for that instance of any of the other ones
229
-
230
215
## async composers
231
216
232
217
`gulp.start` is not enough when you need to compose tasks since it runs them. If you want to compose tasks, you need another function that will run a set of tasks.
@@ -270,6 +255,25 @@ function stack(tasks...[, Object options])
270
255
- `options.onHandleError` if given, will run when a task errors
271
256
- `options.onStackEnd` if given, will run when all of the stacked functions have ended (including error)
272
257
258
+
## REPL
259
+
260
+
```js
261
+
var gulp = require('gulp-runtime').create({repl:true});
262
+
```
263
+
264
+
When an instance passes `repl: true` the process running will not stop but wait and have a REPL listening on `stdin`. This way you can run tasks in the same way you run commands on the terminal.
265
+
266
+
```js
267
+
node gulpfile.js
268
+
# some task logging here...
269
+
# when done press enter
270
+
> build less compress png
271
+
```
272
+
273
+
- If those tasks are defined they will run in __parallel__
274
+
- If there is more than one instance with `repl: true` the REPL will go through them and run the first task that matched one of those tasks
275
+
- If one or more of those tasks is not defined there will be a warning and none of the tasks will run for that instance of any of the other ones
276
+
273
277
## instances
274
278
275
279
Exactly, instances. That means that you can split builds into instances within the same process and run them separately. Which is a bit better than taking care of naming or spin another process to run them separated. This is also better for performance since all of the modules that may be used by other build can be reused.
0 commit comments