cpace
is a tool that helps develop [.c] and [.cpp] based applications by automatically restarting them when file changes are detected. The package was built to automate the compilation and running of [.exe] files when writing C/C++ applications.
Node.js
(to usecpace
) (how to install / download)gcc
/g++
(to compile the project) (how to install / download)
The best way to install cpace is using npm (pnpm or yarn are also suitable):
npm install cpace --global
# or
npm i cpace -g
cpace will be installed globally to your system path. With a global installation cpace will be available anywhere.
You can also install cpace as a development dependency:
npm install cpace --save-dev
# of
npm i cpace -D
When installed locally, cpace will not be available in your system path, and you will not be able to use it directly from the command line.
cpace wraps your application, so you just have to pass your file name (and directory, if needed):
# for C files
cpace ./file.c
# for C++ files
cpace ./file.cpp
CLI help: -h
(or --help
)
cpace -h
# or
cpace --help
Compilation without starting the program: -c
(or --compileOnly
)
cpace ./file.cpp -c
# or
cpace ./file.cpp -compileOnly
Browsing a directory and compiling a specific file: -d
(or --directory
)
# file name must be after the -d argument
cpace ./file.cpp -d ./src
To update the local installation:
npm update cpace
To update the global installation:
npm update -g cpace
cpace was written to restart C and C++ applications. If your script exits cleanly, cpace will continue to monitor the file and restart it if there are any changes. If there is an error, cpace will notify you in the console.
Tested on MacOS Monterey, MacOS Ventura, Windows 10, Windows 11.