diff options
Diffstat (limited to 'bin/load-style.js')
-rwxr-xr-x | bin/load-style.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/load-style.js b/bin/load-style.js new file mode 100755 index 0000000000..48aa6ecc47 --- /dev/null +++ b/bin/load-style.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var brfs = require('brfs'); + +module.exports = function(file) { + var fromFile = file && file !== '-'; + var rs = fromFile ? fs.createReadStream(file) : process.stdin; + var fpath = fromFile ? file : path.join(process.cwd(), '-'); + return rs.pipe(brfs(fpath)); +}; + +if (!module.parent) module.exports(process.argv[2]).pipe(process.stdout); |