Skip to content

Commit 399823e

Browse files
committed
added: streamer
1 parent a4dcf94 commit 399823e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

streamer/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require('total.js');
2+
3+
U.download('http://www.w3schools.com/xml/cd_catalog.xml', ['get'], null, function(err, response) {
4+
response.on('data', U.streamer('</CD>', function(value, index) {
5+
if (index === 0)
6+
value = value.substring(value.indexOf('<CD'));
7+
var xml = value.parseXML();
8+
xml.index = index;
9+
console.log(xml);
10+
}));
11+
});

0 commit comments

Comments
 (0)