in.actor.read
v0.0.4
Published
File reader for in.
Downloads
3
Readme
in.actor.read
File reader for in.
This actor is bundled with in.
$$in(function(readme) { // in. read README.md
})
It can be accessed with alias <
$$in(function(readme) { // in. < README.md
})
$$in(function(lines) { // in.as.lines < ./README.md
})
$$in(function(stream) { // in.as.stream < {{process.cwd()}}/README.md
stream.on('data', ...
stream.on('end', ...
stream.on('error', ...
})
$$in(function(streams) { // in.as.stream.lines < {{ $$files('~/repos/**/README.md') }}
streams.forEach(function(stream) {
// one stream per found readme
stream.on('data', ... // for each line
stream.on('end', ...
stream.on('error', ...
})
$$in(function(raw) { // in.as.buffer < CANT_README
})
$$in(function(raw) { // in.as.stream.buffer < /dev/random
stream.on('data', ...
stream.on('end', ...
stream.on('error', ...
})
NB It accepts only one filename!
$$in(function(lines) { // in.as.lines < file1.txt file2.txt
// will attempt to read 'file1.txt file2.txt'
})