This is a Node.js project that compiles and runs C/C++ code. It takes the name of the C/C++ file as input, compiles and runs it on changes. The project also includes some extra options, such as -h for help and -st for saving temporary files.
To use this project, you must have Node.js and a C/C++ compiler installed on your system.
npx cpprunner <filename>
Install as npm package
npm i cpprunner
Usage:
import run from "cpprunner";
const filepath = "path/to/your/file"; // without the extension
const extension = "c";
run(filepath, extension);
- Clone the repository to your local machine using
git clone https://github.com/mind0bender/cpprunner.git
. - Navigate to the project directory using
cd cpprunner
. - Install the required dependencies using
yarn
.
Usage:
The cpprunner
takes the following options:
To compile and run a C/C++ file, navigate to the project directory and run the following command:
yarn start <filename>
optional arguments:
-st : save temp files
-h : help
Make sure to replace <filename>
with the name of your program file.