Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleshkooo/npm-cpace
cpace - nodemon for C/C++ files. Monitor for any changes in your [.c] and [.cpp] application and automatically restart it - perfect for development
https://github.com/oleshkooo/npm-cpace
autoreload c cli cpace cpp development monitor nodemon reload restart terminal
Last synced: about 1 month ago
JSON representation
cpace - nodemon for C/C++ files. Monitor for any changes in your [.c] and [.cpp] application and automatically restart it - perfect for development
- Host: GitHub
- URL: https://github.com/oleshkooo/npm-cpace
- Owner: oleshkooo
- License: mit
- Created: 2022-04-09T16:16:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T16:01:22.000Z (almost 2 years ago)
- Last Synced: 2024-11-07T23:09:55.208Z (about 1 month ago)
- Topics: autoreload, c, cli, cpace, cpp, development, monitor, nodemon, reload, restart, terminal
- Language: JavaScript
- Homepage:
- Size: 1.94 MB
- Stars: 20
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cpace
`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.
# Requirements
- `Node.js` (to use `cpace`) (**[how to install](https://nodejs.dev/learn/how-to-install-nodejs) / [download](https://nodejs.dev/download)**)
- `gcc`/`g++` (to compile the project) (**[how to install](https://www.youtube.com/watch?v=sXW2VLrQ3Bs) / [download](https://sourceforge.net/projects/mingw)**)
# Installation
The best way to install cpace is using [npm](https://www.npmjs.com/package/cpace) _(pnpm or yarn are also suitable)_:
```bash
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:
```bash
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.
# Usage
cpace wraps your application, so you just have to pass your file name (and directory, if needed):
```bash
# for C files
cpace ./file.c# for C++ files
cpace ./file.cpp
```
CLI help: `-h` (or `--help`)
```bash
cpace -h
# or
cpace --help
```
Compilation without starting the program: `-c` (or `--compileOnly`)
```bash
cpace ./file.cpp -c
# or
cpace ./file.cpp -compileOnly
```
Browsing a directory and compiling a specific file: `-d` (or `--directory`)
```bash
# file name must be after the -d argument
cpace ./file.cpp -d ./src
```
# Update
To update the **local** installation:
```bash
npm update cpace
```
To update the **global** installation:
```bash
npm update -g cpace
```
# Notice
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._