0.1.112 • Published 5 years ago
json-stdio v0.1.112
json-stdio
This library allows two Node.js processes to easily communicate via stdout/stderr/stdin.
Usage / Getting Started
Importing
import stdio = require('json-stdio'); // TypeScript
import * as stdio from 'json-stdio'; // ESNext / ES-Whatever
const stdio = require('json-stdio'); // Old-Skool
Writing to stdout/stderr (sender process):
// log a file path, which can be received by another process
const stdio = require('json-stdio');
const filePath = '/foo/bar';
stdio.log({fp: filePath});
stdio.logerr({fp: filePath});
Parsing a stream (receiver process)
const stdio = require('json-stdio');
const cp = require('child_process');
const k = cp.spawn('bash');
const parser = stdio.createParser();
const stdEventName = stdio.stdEventName; // '@json-stdio-event'
k.stdout.pipe(parser).on(stdEventName, obj => {
// obj is an object like so:
// {fp: '/foo/bar'}
});
0.1.112
5 years ago
0.1.111
5 years ago
0.1.109
5 years ago
0.1.1011
6 years ago
0.1.1010
6 years ago
0.1.1009
6 years ago
0.1.1008
6 years ago
0.1.1007
6 years ago
0.1.1005
6 years ago
0.1.1004
6 years ago
0.1.1003
6 years ago
0.0.1017
7 years ago
0.0.1016
7 years ago
0.0.1015
7 years ago
0.0.1014
7 years ago
0.0.1010
7 years ago
0.0.1009
7 years ago
0.0.1008
7 years ago
0.0.1007
7 years ago
0.0.1006
7 years ago
0.0.1004
7 years ago
0.0.1003
7 years ago