node-terminal-table-parser
node-terminal-table-parser parses data from simple terminal tables.
Installation
Install with npm from npm
npm install terminal-table-parser
Install with npm from github
npm install git+https://github.com/sgen/node-terminal-table-parser.git
Clone with git
git clone http://github.com/sgen/node-terminal-table-parser
Usage
Parse PS output
var parse = require('node-terminal-table-parser'); var output = ' PID TTY TIME CMD\n' + ' 278 pts/22 00:00:00 bash\n' + '18279 pts/22 00:00:00 ps\n'; var results = parse(output); // outputs// [// {PID: '278', TTY: 'pts/22', TIME: '00:00:00', CMD: 'bash'},// {PID: '18279', TTY: 'pts/22', TIME: '00:00:00', CMD: 'ps'}// ]