Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 674 Bytes

File metadata and controls

26 lines (18 loc) · 674 Bytes

Bash Interpreter

NodeJS package for converting standard bash command output to JS objects.

Getting started

npm install --save Vegard-/node-bash-interpreter

Usage

let bashInterpreter = require('bash-interpreter');
let objects = bashInterpreter.parse(myBashOutput);
console.log(objects);

Mapping bash headers with custom names

The following would convert all headers "MY_BASH_HEADER_NAME" to "myObjectKeyName".

let bashInterpreter = require('bash-interpreter');
let objects = bashInterpreter.parse(myBashOutput, {
  headers: {
    "MY_BASH_HEADER_NAME": "myObjectKeyName"
  }
});
console.log(objects);