diff --git a/README.md b/README.md index 7b30ff0..e73351c 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,11 @@ Runs COBOL code from Node.JS side. #### Params - **Function|String|Path** `input`: A function containing a comment with inline COBOL code, the cobol code itself or a path to a COBOL file. - **Object** `options`: An object containing the following fields: + - `cwd` (String): Where the COBOL code will run (by default in the current working directory) + - `args` (Array): An array of strings to pass to the COBOL process. + - `stdin` (Stream): An optional stdin stream used to pipe data to the stdin stream of the COBOL process. + - `stderr` (Stream): An optional stderr stream used to pipe data to the stdin stream of the COBOL process. + - `stdeout` (Stream): An optional stdout stream used to pipe data to the stdin stream of the COBOL process. - **Function** `callback`: The callback function called with `err`, `stdout` and `stderr`. ## How to contribute diff --git a/lib/index.js b/lib/index.js index 2f3b32a..a065800 100644 --- a/lib/index.js +++ b/lib/index.js @@ -18,6 +18,13 @@ var Spawn = require("child_process").spawn * @function * @param {Function|String|Path} input A function containing a comment with inline COBOL code, the cobol code itself or a path to a COBOL file. * @param {Object} options An object containing the following fields: + * + * - `cwd` (String): Where the COBOL code will run (by default in the current working directory) + * - `args` (Array): An array of strings to pass to the COBOL process. + * - `stdin` (Stream): An optional stdin stream used to pipe data to the stdin stream of the COBOL process. + * - `stderr` (Stream): An optional stderr stream used to pipe data to the stdin stream of the COBOL process. + * - `stdeout` (Stream): An optional stdout stream used to pipe data to the stdin stream of the COBOL process. + * * @param {Function} callback The callback function called with `err`, `stdout` and `stderr`. */ function Cobol(input, options, callback) {