Files: 5a0419f6c2662e881e7cb6c76d64e1b5b1f55de7 / tests / json2msg.js
375 bytesRaw
1 | |
2 | |
3 | var fs = require('fs'); |
4 | var readline = require('readline'); |
5 | |
6 | var nativeMessage = require('chrome-native-messaging'); |
7 | |
8 | var output = new nativeMessage.Output(); |
9 | |
10 | readline.createInterface({ |
11 | input: process.stdin, |
12 | output: output, |
13 | terminal: false |
14 | }).on('line', function(line) { |
15 | output.write(JSON.parse(line)); |
16 | }); |
17 | |
18 | output.pipe(process.stdout); |
19 |
Built with git-ssb-web