COBOL bridge for NodeJS which allows you to run COBOL code from NodeJS.
Of course, you can! It's production ready! If you ever did such a thing, ping me (@IonicaBizau). 💥 💫
Currently GNUCobol is required. If you are using a debian-based distribution you can install it using:
$ sudo apt-get install open-cobol💡 It would be interesting to fallback into a COBOL compiler written in NodeJS. Contributions are welcome! 😄
Then, install the cobol package.
$ npm i cobol// Dependencies var Cobol = ; // Execute some COBOL snippets ;// => "Hello World" ;// => "Your name is: Alice" // This will read data from stdin ;// => Write something and then press the <Enter> key // <= Hi there! // => You wrote: Hi there! // => ------------ Cobol(input, options, callback)Runs COBOL code from Node.JS side.
input: A function containing a comment with inline COBOL code, the cobol code itself or a path to a COBOL file.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.free (Boolean): Use free option while compiling with GnuCobolstdin (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.remove (Boolean): Should the compiled executable be removed after running, default is true.precompiled (Boolean): Run the precompiled executable instead of re-compiling, default is false.callback: The callback function called with err, stdout and stderr.This project seems to more popular than I expected. 😄 If you wrote or found an article about this project which is not added in this list, add it.
Have an idea? Found a bug? See how to contribute.
If you are using this library in one of your projects, add it in this list. ✨
cobol-promises—COBOL bridge for NodeJS with promises support.node.cobol—Node.js bridge for COBOL which allows you to run Node.js code from COBOL.fortran—Fortran bridge for Node.js which allows you to run Fortran code from Node.js.node.fortran—Execute Node.js in your Fortran programs.