Skip to content

Commit 323529f

Browse files
committed
Switching to streams 2 API
1 parent 8dae72c commit 323529f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
var map = require("map-stream"),
1+
var Stream = require("stream"),
22
Path = require("path");
33

4-
module.exports = function (obj) {
4+
function gulpRename(obj) {
55
"use strict";
66

7+
var stream = new Stream.Transform({objectMode: true});
8+
79
function parsePath(path) {
810
var extname = Path.extname(path);
911
return {
@@ -13,7 +15,7 @@ module.exports = function (obj) {
1315
};
1416
}
1517

16-
function rename(file, callback) {
18+
stream._transform = function(file, unused, callback) {
1719

1820
var parsedPath = parsePath(file.relative);
1921
var path;
@@ -49,5 +51,8 @@ module.exports = function (obj) {
4951
callback(null, file);
5052
}
5153

52-
return map(rename);
54+
return stream;
5355
};
56+
57+
module.exports = gulpRename;
58+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"gulp-jshint": ">=1.1.0"
3131
},
3232
"engines": {
33-
"node": ">=0.8.0",
33+
"node": ">=0.10.0",
3434
"npm": ">=1.2.10"
3535
},
3636
"licenses": [

0 commit comments

Comments
 (0)