cpoach.sh 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ name: On Push
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ - master
7
+ tags:
8
+ - '!*' # Do not execute on tags
9
+ env:
10
+ NAME: ${{vars.NAME}}
11
+ EMAIL: ${{vars.EMAIL}}
12
+ NPM_TOKEN: ${{secrets.NPM_TOKEN}}
13
+ GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
14
+ FORCE_COLOR: 1
15
+
16
+
17
+ jobs:
18
+ publish:
19
+ name: Publish packages
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+ - uses: actions/setup-node@v6
24
+ with:
25
+ node-version: 24.x
26
+ - uses: nodef/npm-config.action@v1.2.0
27
+ with:
28
+ credentials: auto
29
+ entries: access=public
30
+ env:
31
+ GITHUB_TOKEN: ${{env.GITHUB_TOKEN}}
32
+ NPM_TOKEN: ${{env.NPM_TOKEN}}
33
+ - run: npm publish
34
+ env:
35
+ NODE_AUTH_TOKEN: ${{env.NPM_TOKEN}}
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Subhajit Sahu
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Subhajit Sahu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,109 +1,568 @@
1
- <!-- ![](https://github.com/user-attachments/assets/ed3e5a8f-c8df-4644-b643-80620da189fb) -->
2
-
3
- <p align="center">
4
- <img src="https://github.com/user-attachments/assets/ed3e5a8f-c8df-4644-b643-80620da189fb" alt="cpoach logo" width="60%"/>
5
- </p>
6
-
7
- **cpoach** is a support tool designed to simplify the use of single-file C/C++ libraries. These libraries can be effortlessly installed via `npm`, making it easier to integrate them into your projects without the hassle of *managing build systems* or including third-party libraries in your version control. Refer to the [website](https://nodef.github.io) for the list of available libraries.
8
-
9
- ### Features
10
-
11
- - Install and use C/C++ libraries as easily as `#include <stdio.h>`.
12
- - Libraries are available via NPM for seamless installation.
13
- - Ideal for in-class demonstrations and assignments.
14
- - Access libraries for high-performance computing, graphics, networking, cryptography, and more.
15
-
16
- <br>
17
-
18
- ## Installation
19
-
20
- To install *cpoach*, use the following command:
21
-
22
- ```bash
23
- npm i -g cpoach.sh
24
- ```
25
-
26
- <br>
27
-
28
- ## Usage
29
-
30
- After installation, you can include the desired libraries in your C/C++ projects. For example, if you want to use the [tigr.c] library for graphics, follow these steps:
31
-
32
- Run:
33
-
34
- ```bash
35
- $ npm i tigr.c
36
- ```
37
-
38
- And then include `tigr.h` as follows:
39
-
40
- ```c
41
- // main.c
42
- #define TIGR_IMPLEMENTATION
43
- #include <tigr.h>
44
-
45
- int main() { /* ... */ }
46
- ```
47
-
48
- And then compile with **clang**, **gcc**, or **MSVC** as follows:
49
-
50
- ```bash
51
- $ cpoach clang main.c # or, use gcc
52
- $ cpoach gcc main.c # or, use MSVC
53
- $ cpoach cl main.c
54
- # NOTE: clang++ and g++ can also be used
55
- ```
56
-
57
- You can also manually retrieve the include flags and use them in your compilation command:
58
-
59
- ```bash
60
- $ clang $(cpoach i) main.c # or, use gcc
61
- $ gcc $(cpoach i) main.c # or, use MSVC
62
- $ cl $(cpoach i --msvc) main.c
63
- ```
64
-
65
- On command prompt (Windows), use the following commands instead:
66
-
67
- ```batch
68
- > FOR /F "tokens=*" %%i IN ('cpoach i') DO clang++ %%i main.cxx REM or, use g++
69
- > FOR /F "tokens=*" %%i IN ('cpoach i') DO g++ %%i main.cxx REM or, use MSVC
70
- > FOR /F "tokens=*" %%i IN ('cpoach i --msvc') DO cl %%i main.cxx
71
- ```
72
-
73
- As mentioned earlier, the catalog of available libraries is available on the [website](https://nodef.github.io).
74
-
75
- [tigr.c]: https://www.npmjs.com/package/tigr.c
76
-
77
- <br>
78
-
79
- ## Documentation
80
-
81
- ```bash
82
- $ cpoach [command] [options]
83
-
84
- Usage: cpoach [command] [options]
85
-
86
- Commands:
87
- i | includes Generate compiler flags for include paths.
88
- gcc | clang | cl Run compiler, passing the include flags.
89
-
90
- Options:
91
- --compiler [name] Specify the compiler (msvc, gcc, clang). Default is gcc.
92
- --msvc Shortcut for --compiler msvc.
93
- --gcc Shortcut for --compiler gcc.
94
- --clang Shortcut for --compiler clang.
95
- --help Display help information.
96
- ```
97
-
98
- <br>
99
-
100
- ## Contributing
101
-
102
- We welcome contributions! If you have suggestions, please open an issue on our [GitHub repository](https://github.com/nodef/cpoach.sh/issues).
103
-
104
- <br>
105
- <br>
106
-
107
-
108
- [![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
109
- ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/cpoach.sh)
1
+ ![](https://github.com/user-attachments/assets/459f91c1-c313-4f3a-b4e1-14edc4fb358f)
2
+
3
+ **cpoach** is a support tool designed to simplify the use of single-file C/C++ libraries. These libraries can be effortlessly installed via `npm`, making it easier to integrate them into your projects without the hassle of *managing build systems* (rather, just like `#include <stdio.h>`), and without including the third-party libraries into the project's version control. This is mainly to facilitate in-class demonstrations and assignments.
4
+
5
+ The name **cpoach** is a playful nod to the idea of *poaching* awesome C/C++ libraries and making them easily accessible for educational purposes. Many of these libraries are listed in [r-lyeh/single_file_libs](https://github.com/r-lyeh/single_file_libs), [fffaraz/awesome-cpp](https://github.com/fffaraz/awesome-cpp), or [p-ranav/awesome-hpp](https://github.com/p-ranav/awesome-hpp). I was listening to Eskil Steenberg's talk on [Advanced C](https://www.youtube.com/watch?v=w3_e9vZj7D8), which you should also look into. He also has a [collection of C libraries](https://gamepipeline.org/index.html) that you may want to explore.
6
+
7
+ Issues or suggestions regarding a specific library should be directed to the original library repository. However, for issues or suggestions related to the **cpoach** project, please [open an issue here](https://github.com/nodef/cpoach.sh/issues).
8
+
9
+ <br>
10
+
11
+ ## Usage
12
+
13
+ To install *cpoach*, use the following command:
14
+
15
+ ```bash
16
+ $ npm i -g cpoach.sh
17
+ ```
18
+
19
+ After installation, you can include the desired libraries in your C/C++ projects. For example, if you want to use the [tigr.c] library for graphics, follow these steps:
20
+
21
+ Run:
22
+
23
+ ```bash
24
+ $ npm i tigr.c
25
+ ```
26
+
27
+ And then include `tigr.h` as follows:
28
+
29
+ ```c
30
+ // main.c
31
+ #define TIGR_IMPLEMENTATION
32
+ #include <tigr.h>
33
+
34
+ int main() { /* ... */ }
35
+ ```
36
+
37
+ And then compile with `clang` or `gcc` as usual.
38
+
39
+ ```bash
40
+ $ clang $(cpoach i) main.c # or, use gcc
41
+ $ gcc $(cpoach i) main.c
42
+ ```
43
+
44
+ <br>
45
+
46
+ ## Documentation
47
+
48
+ ```bash
49
+ $ cpoach [command] [options]
50
+
51
+ Usage: cpoach [command] [options]
52
+
53
+ Commands:
54
+ i | includes Generate compiler flags for include paths.
55
+
56
+ Options:
57
+ --compiler [name] Specify the compiler (msvc, gcc, clang). Default is gcc.
58
+ --msvc Shortcut for --compiler msvc.
59
+ --gcc Shortcut for --compiler gcc.
60
+ --clang Shortcut for --compiler clang.
61
+ --help Display help information.
62
+ ```
63
+
64
+ <br>
65
+ <br>
66
+
67
+ ## Available Libraries
68
+
69
+ Below is a categorized list of single-file C/C++ libraries available through the **cpoach** project:
70
+
71
+ <details markdown="1">
72
+ <summary>🍳 Army knives</summary>
73
+ <br>
74
+
75
+ | Package | Description |
76
+ | ---- | ---- |
77
+ | ⚙️ [boost.cxx] | A collection of high-quality, free, and open-source libraries that extend the functionality of the C++ programming language; Dawes et al. (1998). |
78
+ | ⚙️ [stb.c] | stb single-file public domain libraries for C/C++; Sean Barrett (2014). |
79
+ | ⚙️ [plibsys.c] | Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance; Alexander Saprykin (2010). |
80
+ | ⚙️ [libgb.c] | gb single-file public domain libraries for C & C++; gingerBill (2015). |
81
+ | ⌛ [prideout.c] | single-file C libraries from Philip Allan Rideout; Philip Rideout (2015). |
82
+
83
+ <br>
84
+ </details>
85
+
86
+ <details markdown="1">
87
+ <summary>🍳 High Performance Computing (HPC)</summary>
88
+ <br>
89
+
90
+ | Package | Description |
91
+ | ---- | ---- |
92
+ | ⚙️ [taskflow.cxx] | A General-purpose Task-parallel Programming System using Modern C++; Tsung-Wei Huang (2018). |
93
+ | ⚙️ [subprocess.c] | 🐜 Single header process launching solution for C and C++; Neil Henning (2017). |
94
+ | ⚙️ [tinycthread.c] | Small, portable implementation of the C11 threads API; Evan Nemerson (2012). |
95
+ | ⚙️ [pthreads4w.c] | POSIX threads API for Windows from https://sourceforge.net/p/pthreads4w; Ben Elliston (1998). |
96
+ | ⚙️ [minicoro.c] | Single header stackful cross-platform coroutine library in pure C; Eduardo Bart (2021). |
97
+ | ⚙️ [cds_sync.c] | Single-header C90 collection of synchronization primitives; Cort Stratton (2015). |
98
+ | ⚙️ [buddy_alloc.c] | A single header buddy memory allocator for C & C++; Stanislav Paskalev (2021). |
99
+ | ⚙️ [rfft.c] | Reasonably fast Fourier transform in a single header for C and C++; grego (2023). |
100
+ | ⚙️ [xxhash.c] | Extremely fast non-cryptographic hash algorithm; Yann Collet (2012). |
101
+ | ⚙️ [linmath.c] | A lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions; Wolfgang Draxinger (2013). |
102
+ | ⚙️ [algebra3.cxx] | Vector utilities for 2, 3, and 4 element vectors, all inline; Jean-Francois Doue, Paul S. Heckbert, and J. Nagle (1993). |
103
+ | ⚙️ [stb_stats.c] | Single header file with a bunch of useful statistical functions such as ANOVA, Kruskal-Wallis, T-test, etc; Gerben Voshol (2018). |
104
+ | ⚙️ [cxxgraph.cxx] | Header-Only C++ Library for Graph Representation and Algorithms; ZigRazor (2020). |
105
+ | ⌛ [opencl.c] | C/C++ language headers for the OpenCL API; The Khronos Group (2013). |
106
+ | ⌛ **clew.c** | The OpenCL Extension Wrangler Library; Martijn Berger ([XXXX](https://github.com/martijnberger/clew)). |
107
+ | ⌛ [bikeshed.c] | Lock free hierarchical work scheduler; Dan Engelbrecht (2019). |
108
+ | ⌛ **jemalloc.c** | jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support; Jason Evans ([XXXX](https://github.com/jemalloc/jemalloc)). |
109
+ | ⌛ [genann.c] | simple neural network library in ANSI C; Lewis Van Winkle (2016). |
110
+ | ⌛ [kann.c] | A lightweight C library for artificial neural networks; Attractive Chaos (2016). |
111
+ | ⌛ **robin-map.cxx** | C++ implementation of a fast hash map and hash set using robin hood hashing; Thibaut Goetghebuer-Planchon ([XXXX](https://github.com/Tessil/robin-map)). |
112
+ | ⌛ [uthash.c] | C macros for hash tables and more; Troy D. Hanson (2005). |
113
+ | ⌛ **cephes.c** | Mirror of the Cephes C source for reference; Stephen L. Moshier ([XXXX](https://github.com/jeremybarnes/cephes)). |
114
+ | ⌛ [hypatia.c] | A header-only, pure-C math library for 2D/3D graphics (matrix, vector, quaternion) Seeks to be close to C89/C90 compliant for portability. It's like a BLAS, but easier to use; Darryl T. Agostinelli (2015). |
115
+ | ⌛ [handmademath.c] | A simple math library for games and computer graphics. Compatible with both C and C++. Public domain and easy to modify; Ben Visness (2016). |
116
+ | ⌛ [ccvector.c] | A vector and matrix math library; Job Talle (2015). |
117
+ | ⌛ [doops.c] | Single C file event loop; Eduard Suica (2019). |
118
+ | ⌛ [ranxoshi256.c] | Portable, single-file, PRNG library implementing the xoshiro256** algorithm; BareRose (2018). |
119
+ | ⌛ [uuid4.c] | UUID v4 generation in C; Grégory Pakosz (2019). |
120
+ | ⌛ [uuid_h.c] | Single file, STB-style, "lib" to generate uuid:s; Fredrik Kihlander (2016). |
121
+ | ⌛ **range-v3.cxx** | Range library for C++14/17/20, basis for C++20's std::ranges; Eric Niebler ([XXXX](https://github.com/Tessil/robin-map)). |
122
+
123
+ <br>
124
+ </details>
125
+
126
+ <details markdown="1">
127
+ <summary> 🍳 Computer Graphics</summary>
128
+ <br>
129
+
130
+ | Package | Description |
131
+ | ---- | ---- |
132
+ | ⚙️ [clay.c] | High performance UI layout library in C; Nic Barker (2024). |
133
+ | ⚙️ [nuklear.c] | A single-header ANSI C immediate mode cross-platform GUI library; Micha Mettke (2015). |
134
+ | ⚙️ [microui.c] | A tiny immediate-mode UI library; rxi (2018). |
135
+ | ⚙️ [tigr.c] | TIGR - the TIny GRaphics library for Windows, macOS, Linux, iOS and Android. |
136
+ | ⚙️ [rgfw.c] | A cross platform lightweight single-header simple-to-use window abstraction library for creating graphical programs or libraries; Riley Mabb (2023). |
137
+ | ⚙️ [glfw3.c] | A multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop; Marcus Geelnard (2002). |
138
+ | ⚙️ [glad.c] | Vulkan/GL/GLES/EGL/GLX/WGL Loader based on the official specs, using glad by David Herberth (2013). |
139
+ | ⚙️ [vulkan.c] | Vulkan header files and API registry; The Khronos Group (2018). |
140
+ | ⚙️ [egl.c] | EGL API and Extension Registry; The Khronos Group (2016). |
141
+ | ⚙️ [voxelizer.c] | Header only mesh voxelizer in c99; Karim Naaji (2016). |
142
+ | ⌛ [sdl3.c] | Simple DirectMedia Layer; Sam Lantinga (1997). |
143
+ | ⌛ **openvr.c** | OpenVR SDK; Valve Software ([XXXX](https://github.com/ValveSoftware/openvr)). |
144
+ | ⌛ [openmodal.c] | Dependency free, cross-platform, single header lib to open native file modals; bzt (2023). |
145
+ | ⌛ [tinyfiledialogs.c] | Modal dia logs inc. file open/save (Win/Mac/Linux); Guillaume Vareille (2014). |
146
+ | ⌛ [lightmapper.c] | A C/C++ single-file library for drop-in lightmap baking. Just use your existing OpenGL renderer to bounce light; ands (2016). |
147
+ | ⌛ [sdl3.c] | Simple DirectMedia Layer; Sam Lantinga (1997). |
148
+ | ⌛ [glew.c] | The OpenGL Extension Wrangler Library; Milan Ikits and Marcelo Magallon (2002). |
149
+ | ⌛ [rfont.c] | Simple-to-use single header modular font rendering library written in C; Riley Mabb (2023). |
150
+
151
+ <br>
152
+ </details>
153
+
154
+ <details markdown="1">
155
+ <summary> 🍳 Terminal utilities</summary>
156
+ <br>
157
+
158
+ | Package | Description |
159
+ | ---- | ---- |
160
+ | ⚙️ [indicators.cxx] | Activity Indicators for Modern C++; Pranav (2019). |
161
+ | ⚙️ [rang.cxx] | A Minimal, Header only Modern c++ library for terminal goodies; Abhinav Gauniyal (2016). |
162
+ | ⚙️ [termcolor.cxx] | Termcolor is a header-only C++ library for printing colored messages to the terminal. Written just for fun with a help of the Force; Ihor Kalnytskyi (2013). |
163
+ | ⚙️ [linenoise.c] | A small self-contained alternative to readline and libedit; Salvatore Sanfilippo (2010). |
164
+ | ⚙️ [parg.c] | Parser for argv that works similarly to getopt; Jørgen Ibsen (2015). |
165
+ | ⚙️ [parg.cxx] | A header only c++ library for parsing command line arguments and generating usage/help output; Brett Robinson (2018). |
166
+ | ⚙️ [cmdline.cxx] | A Command Line Parser; Hideyuki Tanaka (2009). |
167
+
168
+ <br>
169
+ </details>
170
+
171
+ <details markdown="1">
172
+ <summary> 🍳 Video</summary>
173
+ <br>
174
+
175
+ | Package | Description |
176
+ | ---- | ---- |
177
+ | ⚙️ [pl_mpeg.c] | Single file C library for decoding MPEG1 Video and MP2 Audio; Dominic Szablewski (2019). |
178
+ | ⌛ [jo_mpeg.c] | Simple, Minimalistic, No Allocations MPEG writer - without audio; Jon Olick and Wladislav Artsimovich (2016). |
179
+
180
+ <br>
181
+ </details>
182
+
183
+ <details markdown="1">
184
+ <summary> 🍳 Audio</summary>
185
+ <br>
186
+
187
+ | Package | Description |
188
+ | ---- | ---- |
189
+ | ⚙️ [miniaudio.c] | Audio playback and capture library written in C, in a single source file; David Reid (2016). |
190
+ | ⚙️ [minimp3.c] | Minimalistic MP3 decoder single header library; Lion (2018). |
191
+ | ⌛ [dr_libs.c] | Audio decoding libraries for C/C++, each in a single source file; David Reid (2015). |
192
+ | ⌛ [tflac.c] | A single file, freestanding FLAC encoding library in C89; John Regan (2024). |
193
+ | ⌛ [pocketmod.c] | Small ANSI C library for turning ProTracker MOD files into playable PCM audio; rombankzero (2018). |
194
+ | ⌛ [atomix.c] | Portable, single-file, wait-free atomic sound mixing library utilizing SSE-accelerated mixing; BareRose (2018). |
195
+
196
+ <br>
197
+ </details>
198
+
199
+ <details markdown="1">
200
+ <summary> 🍳 Networking</summary>
201
+ <br>
202
+
203
+ | Package | Description |
204
+ | ---- | ---- |
205
+ | ⚙️ [httplib.cxx] | A C++ header-only HTTP/HTTPS server and client library; yhirose (2012). |
206
+ | ⌛ [crow.cxx] | A Fast and Easy to use microframework for the web; Jaeseung Ha (2014). |
207
+ | ⌛ [mongoose.c] | Embedded web server, with TCP/IP network stack, MQTT and Websocket; Cesanta Software (2010). |
208
+ | ⌛ [webby.c] | A tiny webserver for game development; Andreas Fredriksson (2012). |
209
+ | ⌛ [concord.c] | A Discord API wrapper library made in C; Cogmasters (2020). |
210
+
211
+ <br>
212
+ </details>
213
+
214
+ <details markdown="1">
215
+ <summary> 🍳 Compression</summary>
216
+ <br>
217
+
218
+ | Package | Description |
219
+ | ---- | ---- |
220
+ | ⚙️ [lz4.c] | Extremely Fast Compression algorithm; lz4 (2011). |
221
+ | ⚙️ [zlib.c] | A massively spiffy yet delicately unobtrusive compression library; Mark Adler (2011). |
222
+ | ⚙️ [dmc_unrar.c] | A dependency-free, single-file FLOSS unrar library; Sven Hesse (2017). |
223
+ | ⌛ [microtar.c] | A lightweight tar library written in ANSI C; rxi (2016). |
224
+ | ⌛ [miniz.c] | miniz: Single C source file zlib-replacement library, originally from code.google.com/p/miniz; Rich Geldreich (2011). |
225
+
226
+ <br>
227
+ </details>
228
+
229
+ <details markdown="1">
230
+ <summary> 🍳 Cryptography</summary>
231
+ <br>
232
+
233
+ | Package | Description |
234
+ | ---- | ---- |
235
+ | ⌛ [monocypher.c] | An easy to use, easy to deploy crypto library; Loup Vaillant (2016). |
236
+
237
+ <br>
238
+ </details>
239
+
240
+ <details markdown="1">
241
+ <summary> 🍳 Serialization</summary>
242
+ <br>
243
+
244
+ | Package | Description |
245
+ | ---- | ---- |
246
+ | ⚙️ [parson.c] | Lightweight JSON library written in C; Krzysztof Gabis (2012). |
247
+ | ⚙️ [mini.cxx] | INI file reader and writer; Danijel Durakovic (2018). |
248
+ | ⚙️ [lurlparser.cxx] | Lightweight URL & URI parser (RFC 1738, RFC 3986); Sergey Kosarevsky (2015). |
249
+ | ⌛ [inih.c] | Simple .INI file parser in C, good for embedded systems; Ben Hoyt (2009). |
250
+ | ⌛ [yxml.c] | Yxml is a small (6 KiB) non-validating yet mostly conforming XML parser written in C; Yorhel (2013). |
251
+ | ⌛ **tiny-json.c** | The tiny-json is a versatile and easy to use json parser in C suitable for embedded systems. It is fast, robust and portable; Rafa Garcia ([XXXX](https://github.com/rafagafe/tiny-json)). |
252
+ | ⌛ [model3d.c] | 3D model format specification and single header SDK. Supports skeletal animations, voxels and has the best data density; bzt (2019). |
253
+ | ⌛ [tinyobjloader.c] | Header only tiny wavefront .obj loader in pure C99; Syoyo Fujita (2016). |
254
+ | ⌛ [fast_obj.c] | Fast C OBJ parser; Richard Knight (2018). |
255
+ | ⌛ [cgltf.c] | 💠 Single-file glTF 2.0 loader and writer written in C99; Johannes Kuhlmann (2018). |
256
+ | ⌛ [qr-code-generator.c] | High-quality QR Code generator library in Java, TypeScript/JavaScript, Python, Rust, C++, C; Nayuki (2016). |
257
+ | ⌛ [cmp.c] | An implementation of the MessagePack serialization format in C / msgpack.org; Charlie Gunyon (2014). |
258
+ | ⌛ [libcmdf.c] | Single-header library for writing CLI applications in C/C++; Ronen Kreimer (2017). |
259
+ | ⌛ [kgflags.c] | kgflags is an easy to use command-line flag parsing library; Krzysztof Gabis (2020). |
260
+
261
+ <br>
262
+ </details>
263
+
264
+ <details markdown="1">
265
+ <summary> 🍳 Text Processing</summary>
266
+ <br>
267
+
268
+ | Package | Description |
269
+ | ---- | ---- |
270
+ | ⚙️ [peglib.cxx] | A single file C++ header-only PEG (Parsing Expression Grammars) library; yhirose (2015). |
271
+ | ⚙️ [remimu.c] | Single-file header-only regex engine, C99/C++11; Alexander Nadeau (2024). |
272
+ | ⚙️ [slre.c] | Super Light Regular Expressions; Aquefir (2013). |
273
+ | ⚙️ [unformat.cxx] | Fastest type-safe parsing library in the world for C++14 or C++17 (up to 300x faster than std::regex); Adam Yaxley (2017). |
274
+ | ⚙️ [ggformat.cxx] | A string formatting library for C++; Michael Savage (2017). |
275
+ | ⚙️ [utf8.c] | 📚 Single header utf8 string functions for C and C++; Neil Henning (2015). |
276
+ | ⚙️ [utf8proc.c] | A clean C library for processing UTF-8 Unicode data; Steven G. Johnson (2014). |
277
+ | ⚙️ [wcwidth9.c] | Platform independent, header only, wcwidth with full unicode 9 support; Joshua Rubin (2016). |
278
+ | ⌛ [str.c] | str: yet another string library for C language; Maxim (2020). |
279
+ | ⌛ [csplit.c] | A single header C library to simplify splitting and processing strings; Jakub Wlodek (2019). |
280
+ | ⌛ [stmr.c] | Porter Stemmer algorithm in C; Titus (2014). |
281
+ | ⌛ [levenshtein.c] | Levenshtein algorithm in C; Titus (2015). |
282
+ | ⌛ **fmt.cxx** | A modern formatting library; Victor Zverovich ([XXXX](https://github.com/fmtlib/fmt)) |
283
+
284
+ <br>
285
+ </details>
286
+
287
+ <details markdown="1">
288
+ <summary> 🍳 Emulation/Scripting</summary>
289
+ <br>
290
+
291
+ | Package | Description |
292
+ | ---- | ---- |
293
+ | ⚙️ [pocketpy.c] | Portable Python 3.x Interpreter in Modern C for Game Scripting; pocketpy (2022). |
294
+ | ⚙️ [minilua.c] | Single-file port of Lua, a powerful scripting language; Eduardo Bart (2020). |
295
+ | ⚙️ [my_basic.c] | A lightweight BASIC interpreter written in standard C in dual files. Aims to be embeddable, extendable and portable; Tony Wang (2014). |
296
+ | ⚙️ [tinyexpr.c] | Tiny recursive descent expression parser, compiler, and evaluation engine for math expressions; Lewis Van Winkle (2016). |
297
+ | ⚙️ [chasm.c] | Chasm Runtime Assembler; Aqil Contractor (2025). |
298
+ | ⌛ [webview.c] | Tiny cross-platform webview library for C/C++. Uses WebKit (GTK/Cocoa) and Edge WebView2 (Windows); Serge Zaitsev (2017). |
299
+ | ⌛ **fex.cxx** | A fast usermode x86 and x86-64 emulator for Arm64 Linux; Ryan Houdek ([XXXX](https://github.com/FEX-Emu/FEX)). |
300
+ | ⌛ **vixl.c** | AArch32 and AArch64 Runtime Code Generation Library; Linaro ([XXXX](https://github.com/Linaro/vixl)). |
301
+ | ⌛ **v86.c** | x86 PC emulator and x86-to-wasm JIT, running in the browser; Fabian ([XXXX](https://github.com/copy/v86)). |
302
+ | ⌛ [agnes.c] | NES emulation library with an easy to use API; Krzysztof Gabis (2019). |
303
+ | ⌛ [apelang.c] | Ape Programming Language; Krzysztof Gabis (2020). |
304
+ | ⌛ **softfloat3.c** | SoftFloat release 3; John Hauser ([XXXX](https://github.com/ucb-bar/berkeley-softfloat-3)). |
305
+
306
+ <br>
307
+ </details>
308
+
309
+ <details markdown="1">
310
+ <summary> 🍳 Testing/Debugging</summary>
311
+ <br>
312
+
313
+ | Package | Description |
314
+ | ---- | ---- |
315
+ | ⚙️ [debugbreak.c] | Break into the debugger programmatically; Scott Tsai (2011). |
316
+ | ⚙️ [b_stacktrace.c] | A minimalistic single-header multi-platform C89 lib for stack tracing; Borislav Stanimirov (2020). |
317
+ | ⚙️ [clove-unit.c] | Single-Header Unit Testing framework for C (interoperable with C++) with test autodiscovery feature; Federico De Felici (2021). |
318
+ | ⚙️ [rexo.c] | Neat single-file cross-platform unit testing framework for C/C++; Christopher Crouzet (2018). |
319
+ | ⌛ [remotery.c] | Single C file, Realtime CPU/GPU Profiler with Remote Web Viewer; Celtoys (2014). |
320
+ | ⌛ **tracy.cxx** | Frame profiler; Bartosz Taudul ([XXXX](https://github.com/wolfpld/tracy)). |
321
+ | ⌛ [errnoname.c] | errnoname is a C library that lets us get the symbolic name for each errno integer value; mentalisttraceur (2019). |
322
+ | ⌛ [fctx.c] | C unit testing in a header (works for C++ too!); Ian Blumel (2008). |
323
+ | ⌛ [greatest.c] | A C testing library in 1 file. No dependencies, no dynamic allocation. ISC licensed; Scott Vokes (2012). |
324
+ | ⌛ [utest.c] | 🧪 single header unit testing framework for C and C++; Neil Henning (2015). |
325
+ | ⌛ [minctest.c] | tiny unit testing framework for ANSI C; Lewis Van Winkle (2015). |
326
+ | ⌛ [labrat.c] | Simple, single-file test harness for C/C++; Alex Thayer (2016). |
327
+ | ⌛ [munit.c] | µnit is a small testing framework for C; Evan Nemerson (2016). |
328
+
329
+ <br>
330
+ </details>
331
+
332
+ <details markdown="1">
333
+ <summary> 🍳 Others</summary>
334
+ <br>
335
+
336
+ | Package | Description |
337
+ | ---- | ---- |
338
+ | ⚙️ [units.cxx] | A compile-time, header-only, dimensional analysis and unit conversion library built on C++14 with no dependencies; Nic Holthaus (2016). |
339
+ | ⚙️ [magic_enum.cxx] | Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code; Daniil Goncharov (2019). |
340
+ | ⚙️ [nameof.cxx] | Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum; Daniil Goncharov (2016). |
341
+ | ⚙️ [scope_guard.cxx] | Scope Guard & Defer C++; Daniil Goncharov (2018). |
342
+ | ⚙️ [semver.cxx] | Semantic Versioning for modern C++; Daniil Goncharov (2018). |
343
+ | ⚙️ [hedley.c] | A C/C++ header to help move #ifdefs out of your code; Evan Nemerson (2016). |
344
+ | ⚙️ [catch2.cxx] | A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch); Martin Hořeňovský (2010). |
345
+ | ⚙️ [macroarg.c] | Manage arguments of macros in C. |
346
+ | ⌛ [endianness.c] | Simple public domain header to get endianess at compile time on a variety of platforms; rofl0r (2017). |
347
+ | ⌛ [asap.cxx] | A C++ header-only library for creating, displaying, iterating and manipulating dates; Leonardo Guilherme de Freitas (2017). |
348
+ | ⌛ [canvas_ity.cxx] | A tiny, single-header canvas-like 2D rasterizer for C++; Andrew Kensler (2022). |
349
+ | ⌛ [cds_job.cxx] | C++11 lock-free job queue; Cort Stratton (2016). |
350
+ | ⌛ [cimg.cxx] | The CImg Library is a small and open-source C++ toolkit for image processing; GREYC (2018). |
351
+ | ⌛ [cista.cxx] | Cista is a simple, high-performance, zero-copy C++ serialization & reflection library; Felix Gündling (2018). |
352
+ | ⌛ [cpp-mmaplib.cxx] | A single file C++11 header-only memory mapped file library; yhirose (2016). |
353
+ | ⌛ [cpp-unicodelib.cxx] | A C++17 header-only Unicode library. (Unicode 16.0.0); yhirose (2016). |
354
+ | ⌛ [debug-draw.cxx] | Immediate-mode, renderer agnostic, lightweight debug drawing API; Guilherme Lampert (2015). |
355
+ | ⌛ [doctest.cxx] | The fastest feature-rich C++11/14/17/20/23 single-header testing framework; Viktor Kirilov (2016). |
356
+ | ⌛ [flags.cxx] | ⛳ Simple, extensible, header-only C++17 argument parser released into the public domain; sailormoon (2016). |
357
+ | ⌛ [hippomocks.cxx] | Single-header mocking framework; Peter Bindels (2008). |
358
+ | ⌛ [imgui.cxx] | Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies; Omar (2014). |
359
+ | ⌛ [immediate2d.cxx] | A C++ drawing framework for Windows that makes simple graphics programming as fun and easy as the days when computers booted directly to a BASIC prompt; Nicholas Piegdon (2017). |
360
+ | ⌛ [inja.cxx] | A Template Engine for Modern C++; Berscheid (2017). |
361
+ | ⌛ [jargsparser.cxx] | A head-only arguments parser(argsparser) c++11 lib; Zhengqiao Wang (2022). |
362
+ | ⌛ [json.cxx] | JSON for Modern C++; Niels Lohmann (2013). |
363
+ | ⌛ [linalg.cxx] | linalg.h is a single header, public domain, short vector math library for C++; Sterling Orsten (2016). |
364
+ | ⌛ [lurlparser.cxx] | Lightweight URL & URI parser (RFC 1738, RFC 3986); Sergey Kosarevsky (2015). |
365
+ | ⌛ [micropather.cxx] | MicroPather is a path finder and A* solver (astar or a-star) written in platform independent C++ that can be easily integrated into existing code. MicroPather focuses on being a path finding engine for video games but is a generic A* solver; Lee Thomason (2012). |
366
+ | ⌛ [microprofile.cxx] | microprofile is an embeddable profiler; Jonas Meyer (2013). |
367
+ | ⌛ [mini-yaml.cxx] | Single header YAML 1.0 C++11 serializer/deserializer; Jimmie Bergmann (2018). |
368
+ | ⌛ [obfuscate.cxx] | Guaranteed compile-time string literal obfuscation header-only library for C++14; Adam Yaxley (2017). |
369
+ | ⌛ [programoptions.cxx] | Single-header program options parsing library for C++11; Fytch (2017). |
370
+ | ⌛ [pugixml.cxx] | Light-weight, simple and fast XML parser for C++ with XPath support; Arseny Kapoulkine (2006). |
371
+ | ⌛ [random.cxx] | Random for modern C++ with convenient API; Illia (2017). |
372
+ | ⌛ [simple-svg.cxx] | Easy to use SVG library for C++ (fork of legacy Google code project archive); Adi Shavit (2015). |
373
+ | ⌛ [str_view.cxx] | Null-termination-aware string-view class for C++; Adam Sawicki (2018). |
374
+ | ⌛ [str.cxx] | Lightweight C++ string type with a configurable local buffer; Omar (2015). |
375
+ | ⌛ [swarmz.cxx] | A free, header-only C++ swarming (flocking) library for real-time applications; Michael (2016). |
376
+ | ⌛ [tinyformat.cxx] | Minimal, type safe printf replacement library for C++; Claire Foster (2011). |
377
+ | ⌛ [tinyobjloader.cxx] | Tiny but powerful single file wavefront obj loader; tinyobjloader (2012). |
378
+ | ⌛ [tinyply.cxx] | 🌍 C++11 ply 3d mesh format importer & exporter; Dimitri Diakopoulos (2015). |
379
+ | ⌛ [tinythread.cxx] | Cross-platform implementation of the C++11 Threads API; Marcus Geelnard (2010). |
380
+ | ⌛ [tinyxml2.cxx] | TinyXML2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs; Lee Thomason (2011). |
381
+ | ⌛ [tomlplusplus.cxx] | Header-only TOML config file parser and serializer for C++17; Mark Gillard (2020). |
382
+ | ⌛ [trompeloeil.cxx] | Header only C++14 mocking framework; Björn Fahller (2014). |
383
+ | ⌛ [utl.cxx] | Collection of self-contained header-only libraries for C++17; DmitriBogdanov (2023). |
384
+ | ⌛ [visit_struct.cxx] | A miniature library for struct-field reflection in C++; Chris Beck (2016). |
385
+ | ⌛ [vulkanmemoryallocator.cxx] | Easy to integrate Vulkan memory allocation library; GPUOpen Libraries & SDKs (2017). |
386
+ | ⌛ [xatlas.cxx] | Mesh parameterization / UV unwrapping library; Jonathan Young (2016). |
387
+
388
+ <br>
389
+ </details>
390
+
391
+ <!-- ⚙️ -->
392
+
393
+ [agnes.c]: https://www.npmjs.com/package/agnes.c
394
+ [apelang.c]: https://www.npmjs.com/package/apelang.c
395
+ [atomix.c]: https://www.npmjs.com/package/atomix.c
396
+ [b_stacktrace.c]: https://www.npmjs.com/package/b_stacktrace.c
397
+ [bikeshed.c]: https://www.npmjs.com/package/bikeshed.c
398
+ [boost.cxx]: https://www.npmjs.com/package/boost.cxx
399
+ [buddy_alloc.c]: https://www.npmjs.com/package/buddy_alloc.c
400
+ [ccvector.c]: https://www.npmjs.com/package/ccvector.c
401
+ [cds_sync.c]: https://www.npmjs.com/package/cds_sync.c
402
+ [cgltf.c]: https://www.npmjs.com/package/cgltf.c
403
+ [chasm.c]: https://www.npmjs.com/package/chasm.c
404
+ [clay.c]: https://www.npmjs.com/package/clay.c
405
+ [clove-unit.c]: https://www.npmjs.com/package/clove-unit.c
406
+ [cmp.c]: https://www.npmjs.com/package/cmp.c
407
+ [concord.c]: https://www.npmjs.com/package/concord.c
408
+ [crow.cxx]: https://www.npmjs.com/package/crow.cxx
409
+ [csplit.c]: https://www.npmjs.com/package/csplit.c
410
+ [cxxgraph.cxx]: https://www.npmjs.com/package/cxxgraph.cxx
411
+ [debugbreak.c]: https://www.npmjs.com/package/debugbreak.c
412
+ [dmc_unrar.c]: https://www.npmjs.com/package/dmc_unrar.c
413
+ [doops.c]: https://www.npmjs.com/package/doops.c
414
+ [dr_libs.c]: https://www.npmjs.com/package/dr_libs.c
415
+ [endianness.c]: https://www.npmjs.com/package/endianness.c
416
+ [errnoname.c]: https://www.npmjs.com/package/errnoname.c
417
+ [fast_obj.c]: https://www.npmjs.com/package/fast_obj.c
418
+ [fctx.c]: https://www.npmjs.com/package/fctx.c
419
+ [genann.c]: https://www.npmjs.com/package/genann.c
420
+ [glad.c]: https://www.npmjs.com/package/glad.c
421
+ [glfw.c]: https://www.npmjs.com/package/glfw.c
422
+ [greatest.c]: https://www.npmjs.com/package/greatest.c
423
+ [handmademath.c]: https://www.npmjs.com/package/handmademath.c
424
+ [hedley.c]: https://www.npmjs.com/package/hedley.c
425
+ [httplib.cxx]: https://www.npmjs.com/package/httplib.cxx
426
+ [hypatia.c]: https://www.npmjs.com/package/hypatia.c
427
+ [indicators.cxx]: https://www.npmjs.com/package/indicators.cxx
428
+ [inih.c]: https://www.npmjs.com/package/inih.c
429
+ [jo_mpeg.c]: https://www.npmjs.com/package/jo_mpeg.c
430
+ [kann.c]: https://www.npmjs.com/package/kann.c
431
+ [kgflags.c]: https://www.npmjs.com/package/kgflags.c
432
+ [labrat.c]: https://www.npmjs.com/package/labrat.c
433
+ [levenshtein.c]: https://www.npmjs.com/package/levenshtein.c
434
+ [libcmdf.c]: https://www.npmjs.com/package/libcmdf.c
435
+ [libgb.c]: https://www.npmjs.com/package/libgb.c
436
+ [lightmapper.c]: https://www.npmjs.com/package/lightmapper.c
437
+ [linenoise.c]: https://www.npmjs.com/package/linenoise.c
438
+ [linmath.c]: https://www.npmjs.com/package/linmath.c
439
+ [lz4.c]: https://www.npmjs.com/package/lz4.c
440
+ [macroarg.c]: https://www.npmjs.com/package/macroarg.c
441
+ [magic_enum.cxx]: https://www.npmjs.com/package/magic_enum.cxx
442
+ [microtar.c]: https://www.npmjs.com/package/microtar.c
443
+ [microui.c]: https://www.npmjs.com/package/microui.c
444
+ [minctest.c]: https://www.npmjs.com/package/minctest.c
445
+ [miniaudio.c]: https://www.npmjs.com/package/miniaudio.c
446
+ [minicoro.c]: https://www.npmjs.com/package/minicoro.c
447
+ [minilua.c]: https://www.npmjs.com/package/minilua.c
448
+ [minimp3.c]: https://www.npmjs.com/package/minimp3.c
449
+ [miniz.c]: https://www.npmjs.com/package/miniz.c
450
+ [model3d.c]: https://www.npmjs.com/package/model3d.c
451
+ [mongoose.c]: https://www.npmjs.com/package/mongoose.c
452
+ [monocypher.c]: https://www.npmjs.com/package/monocypher.c
453
+ [munit.c]: https://www.npmjs.com/package/munit.c
454
+ [my_basic.c]: https://www.npmjs.com/package/my_basic.c
455
+ [nameof.cxx]: https://www.npmjs.com/package/nameof.cxx
456
+ [nuklear.c]: https://www.npmjs.com/package/nuklear.c
457
+ [openmodal.c]: https://www.npmjs.com/package/openmodal.c
458
+ [parg.c]: https://www.npmjs.com/package/parg.c
459
+ [parson.c]: https://www.npmjs.com/package/parson.c
460
+ [peglib.cxx]: https://www.npmjs.com/package/peglib.cxx
461
+ [pl_mpeg.c]: https://www.npmjs.com/package/pl_mpeg.c
462
+ [pocketmod.c]: https://www.npmjs.com/package/pocketmod.c
463
+ [pocketpy.c]: https://www.npmjs.com/package/pocketpy.c
464
+ [prideout.c]: https://www.npmjs.com/package/prideout.c
465
+ [qr-code-generator.c]: https://www.npmjs.com/package/qr-code-generator.c
466
+ [ranxoshi256.c]: https://www.npmjs.com/package/ranxoshi256.c
467
+ [remimu.c]: https://www.npmjs.com/package/remimu.c
468
+ [remotery.c]: https://www.npmjs.com/package/remotery.c
469
+ [rexo.c]: https://www.npmjs.com/package/rexo.c
470
+ [rfft.c]: https://www.npmjs.com/package/rfft.c
471
+ [rfont.c]: https://www.npmjs.com/package/rfont.c
472
+ [rgfw.c]: https://www.npmjs.com/package/rgfw.c
473
+ [scope_guard.cxx]: https://www.npmjs.com/package/scope_guard.cxx
474
+ [semver.cxx]: https://www.npmjs.com/package/semver.cxx
475
+ [slre.c]: https://www.npmjs.com/package/slre.c
476
+ [stb_stats.c]: https://www.npmjs.com/package/stb_stats.c
477
+ [stb.c]: https://www.npmjs.com/package/stb.c
478
+ [stmr.c]: https://www.npmjs.com/package/stmr.c
479
+ [str.c]: https://www.npmjs.com/package/str.c
480
+ [subprocess.c]: https://www.npmjs.com/package/subprocess.c
481
+ [taskflow.cxx]: https://www.npmjs.com/package/taskflow.cxx
482
+ [termcolor.cxx]: https://www.npmjs.com/package/termcolor.cxx
483
+ [tflac.c]: https://www.npmjs.com/package/tflac.c
484
+ [tigr.c]: https://www.npmjs.com/package/tigr.c
485
+ [tinycthread.c]: https://www.npmjs.com/package/tinycthread.c
486
+ [tinyexpr.c]: https://www.npmjs.com/package/tinyexpr.c
487
+ [tinyfiledialogs.c]: https://www.npmjs.com/package/tinyfiledialogs.c
488
+ [tinyobjloader.c]: https://www.npmjs.com/package/tinyobjloader.c
489
+ [utest.c]: https://www.npmjs.com/package/utest.c
490
+ [utf8.c]: https://www.npmjs.com/package/utf8.c
491
+ [utf8proc.c]: https://www.npmjs.com/package/utf8proc.c
492
+ [uthash.c]: https://www.npmjs.com/package/uthash.c
493
+ [uuid_h.c]: https://www.npmjs.com/package/uuid_h.c
494
+ [uuid4.c]: https://www.npmjs.com/package/uuid4.c
495
+ [voxelizer.c]: https://www.npmjs.com/package/voxelizer.c
496
+ [wcwidth9.c]: https://www.npmjs.com/package/wcwidth9.c
497
+ [webby.c]: https://www.npmjs.com/package/webby.c
498
+ [webview.c]: https://www.npmjs.com/package/webview.c
499
+ [yxml.c]: https://www.npmjs.com/package/yxml.c
500
+ [plibsys.c]: https://www.npmjs.com/package/plibsys.c
501
+ [pthreads4w.c]: https://www.npmjs.com/package/pthreads4w.c
502
+ [xxhash.c]: https://www.npmjs.com/package/xxhash.c
503
+ [opencl.c]: https://www.npmjs.com/package/opencl.c
504
+ [glfw3.c]: https://www.npmjs.com/package/glfw3.c
505
+ [vulkan.c]: https://www.npmjs.com/package/vulkan.c
506
+ [egl.c]: https://www.npmjs.com/package/egl.c
507
+ [sdl3.c]: https://www.npmjs.com/package/sdl3.c
508
+ [glew.c]: https://www.npmjs.com/package/glew.c
509
+ [algebra3.cxx]: https://www.npmjs.com/package/algebra3.cxx
510
+ [asap.cxx]: https://www.npmjs.com/package/asap.cxx
511
+ [canvas_ity.cxx]: https://www.npmjs.com/package/canvas_ity.cxx
512
+ [catch2.cxx]: https://www.npmjs.com/package/catch2.cxx
513
+ [cds_job.cxx]: https://www.npmjs.com/package/cds_job.cxx
514
+ [cimg.cxx]: https://www.npmjs.com/package/cimg.cxx
515
+ [cista.cxx]: https://www.npmjs.com/package/cista.cxx
516
+ [cmdline.cxx]: https://www.npmjs.com/package/cmdline.cxx
517
+ [cpp-httplib.cxx]: https://www.npmjs.com/package/cpp-httplib.cxx
518
+ [cpp-mmaplib.cxx]: https://www.npmjs.com/package/cpp-mmaplib.cxx
519
+ [cpp-peglib.cxx]: https://www.npmjs.com/package/cpp-peglib.cxx
520
+ [cpp-unicodelib.cxx]: https://www.npmjs.com/package/cpp-unicodelib.cxx
521
+ [debug-draw.cxx]: https://www.npmjs.com/package/debug-draw.cxx
522
+ [doctest.cxx]: https://www.npmjs.com/package/doctest.cxx
523
+ [flags.cxx]: https://www.npmjs.com/package/flags.cxx
524
+ [ggformat.cxx]: https://www.npmjs.com/package/ggformat.cxx
525
+ [hippomocks.cxx]: https://www.npmjs.com/package/hippomocks.cxx
526
+ [imgui.cxx]: https://www.npmjs.com/package/imgui.cxx
527
+ [immediate2d.cxx]: https://www.npmjs.com/package/immediate2d.cxx
528
+ [inja.cxx]: https://www.npmjs.com/package/inja.cxx
529
+ [jargsparser.cxx]: https://www.npmjs.com/package/jargsparser.cxx
530
+ [json.cxx]: https://www.npmjs.com/package/json.cxx
531
+ [linalg.cxx]: https://www.npmjs.com/package/linalg.cxx
532
+ [lurlparser.cxx]: https://www.npmjs.com/package/lurlparser.cxx
533
+ [micropather.cxx]: https://www.npmjs.com/package/micropather.cxx
534
+ [microprofile.cxx]: https://www.npmjs.com/package/microprofile.cxx
535
+ [mini.cxx]: https://www.npmjs.com/package/mini.cxx
536
+ [mini-yaml.cxx]: https://www.npmjs.com/package/mini-yaml.cxx
537
+ [obfuscate.cxx]: https://www.npmjs.com/package/obfuscate.cxx
538
+ [parg.cxx]: https://www.npmjs.com/package/parg.cxx
539
+ [programoptions.cxx]: https://www.npmjs.com/package/programoptions.cxx
540
+ [pugixml.cxx]: https://www.npmjs.com/package/pugixml.cxx
541
+ [random.cxx]: https://www.npmjs.com/package/random.cxx
542
+ [rang.cxx]: https://www.npmjs.com/package/rang.cxx
543
+ [simple-svg.cxx]: https://www.npmjs.com/package/simple-svg.cxx
544
+ [str_view.cxx]: https://www.npmjs.com/package/str_view.cxx
545
+ [str.cxx]: https://www.npmjs.com/package/str.cxx
546
+ [swarmz.cxx]: https://www.npmjs.com/package/swarmz.cxx
547
+ [tinyformat.cxx]: https://www.npmjs.com/package/tinyformat.cxx
548
+ [tinyobjloader.cxx]: https://www.npmjs.com/package/tinyobjloader.cxx
549
+ [tinyply.cxx]: https://www.npmjs.com/package/tinyply.cxx
550
+ [tinythread.cxx]: https://www.npmjs.com/package/tinythread.cxx
551
+ [tinyxml2.cxx]: https://www.npmjs.com/package/tinyxml2.cxx
552
+ [tomlplusplus.cxx]: https://www.npmjs.com/package/tomlplusplus.cxx
553
+ [trompeloeil.cxx]: https://www.npmjs.com/package/trompeloeil.cxx
554
+ [unformat.cxx]: https://www.npmjs.com/package/unformat.cxx
555
+ [units.cxx]: https://www.npmjs.com/package/units.cxx
556
+ [utl.cxx]: https://www.npmjs.com/package/utl.cxx
557
+ [visit_struct.cxx]: https://www.npmjs.com/package/visit_struct.cxx
558
+ [vulkanmemoryallocator.cxx]: https://www.npmjs.com/package/vulkanmemoryallocator.cxx
559
+ [xatlas.cxx]: https://www.npmjs.com/package/xatlas.cxx
560
+ [zlib.c]: https://www.npmjs.com/package/zlib.c
561
+
562
+ <br>
563
+ <br>
564
+
565
+
566
+ [![](https://raw.githubusercontent.com/qb40/designs/gh-pages/0/image/11.png)](https://wolfram77.github.io)<br>
567
+ [![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
568
+ ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/cpoach.sh)
package/index.js CHANGED
@@ -1,128 +1,89 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const cp = require('child_process');
4
-
5
-
6
- // Get compiler type from its name.
7
- function getCompilerType(name) {
8
- name = name.toLowerCase();
9
- if (name.includes('msvc') || name.includes('cl')) return 'msvc';
10
- if (name.includes('gcc') || name.includes('g++')) return 'gcc';
11
- if (name.includes('clang')) return 'clang';
12
- return null;
13
- }
14
-
15
-
16
- // Get include paths from the current directory's node_modules.
17
- function getIncludes(opt) {
18
- const includes = [];
19
- const cwd = process.cwd();
20
- const pth = path.basename(cwd) === 'node_modules'? cwd : path.join(cwd, 'node_modules');
21
- if (!fs.existsSync(pth) || !fs.statSync(pth).isDirectory()) return includes;
22
- for (const ent of fs.readdirSync(pth)) {
23
- if (!ent.endsWith('.c') && !ent.endsWith('.cxx')) continue;
24
- includes.push(path.join(pth, ent));
25
- }
26
- const FLAG = opt.compiler==='msvc'? '/I' : '-I';
27
- return includes.map(pth => `${FLAG}"${pth}"`);
28
- }
29
-
30
-
31
- // Run the `includes` command, which generates compiler flags for include paths.
32
- function runIncludes(opt) {
33
- console.log(getIncludes(opt).join(' ').trim());
34
- }
35
-
36
-
37
- // Run the `gcc`/`clang`/`cl` command, which runs the compiler with include flags.
38
- function runCompile(opt) {
39
- const includes = getIncludes(opt);
40
- const args = [...includes, ...opt.args];
41
- try { cp.execFileSync(opt.compiler, args, {encoding: 'utf8', stdio: 'inherit'}); }
42
- catch (err) { process.exit(err.status || 1); }
43
- }
44
-
45
-
46
- // Run the help command, which displays usage information.
47
- function runHelp() {
48
- console.error(
49
- `Usage: cpoach [command] [options]\n` +
50
- `\n` +
51
- `Commands:\n` +
52
- ` i | includes Generate compiler flags for include paths.\n` +
53
- ` gcc | clang | cl Run compiler, passing the include flags.\n` +
54
- `\n` +
55
- `Options:\n` +
56
- ` --compiler [name] Specify the compiler (msvc, gcc, clang). Default is gcc.\n` +
57
- ` --msvc Shortcut for --compiler msvc.\n` +
58
- ` --gcc Shortcut for --compiler gcc.\n` +
59
- ` --clang Shortcut for --compiler clang.\n`
60
- );
61
- }
62
-
63
-
64
- // Parse the command name.
65
- function parseCommand(opt, cmd) {
66
- if (/i|includes/.test(cmd)) opt.command = 'includes';
67
- else if (getCompilerType(cmd)) opt.command = 'compile';
68
- else opt.error = `Unknown option: ${cmd}`;
69
- }
70
-
71
- // Parse a single command-line argument.
72
- function parseArg(opt, argv, k, i) {
73
- if (k==='--help') opt.help = true;
74
- else if (k==='--compiler') opt.compiler = argv[++i];
75
- else if (k==='--msvc') opt.compiler = 'msvc';
76
- else if (k==='--gcc') opt.compiler = 'gcc';
77
- else if (k==='--clang') opt.compiler = 'clang';
78
- else if (!opt.command) parseCommand(opt, k);
79
- else if (opt.command !== 'compile') opt.error = `Unknown option: ${k}`;
80
- return i;
81
- }
82
-
83
- // Parse command-line arguments.
84
- function parseArgs(argv) {
85
- const opt = {
86
- error: null,
87
- help: false,
88
- command: null,
89
- compiler: null,
90
- args: [],
91
- };
92
- for (let i=2; i<argv.length; i++)
93
- i = parseArg(opt, argv, argv[i], i);
94
- const compiler = getCompilerType(argv[2]);
95
- if (compiler) {
96
- opt.command = 'compile';
97
- opt.compiler = compiler;
98
- opt.args = argv.slice(3);
99
- }
100
- opt.command = opt.command || 'includes';
101
- opt.compiler = opt.compiler || 'gcc';
102
- return opt;
103
- }
104
-
105
-
106
- // Main entry point.
107
- function main(argv) {
108
- const opt = parseArgs(argv);
109
- if (opt.error) {
110
- console.error(opt.error + '\n');
111
- console.error('Use "cpoach --help" for usage information.');
112
- process.exit(1);
113
- }
114
- if (opt.help) {
115
- runHelp();
116
- process.exit(0);
117
- }
118
- switch (opt.command) {
119
- case 'includes': runIncludes(opt); break;
120
- case 'compile': runCompile(opt); break;
121
- default:
122
- console.error(`Unknown command: ${opt.command}`);
123
- process.exit(1);
124
- }
125
- }
126
-
127
- // Run the main entry point.
128
- main(process.argv);
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+
5
+ // Run the `includes` command, which generates compiler flags for include paths.
6
+ function runIncludes(opt) {
7
+ const includes = [];
8
+ const cwd = process.cwd();
9
+ const pth = path.basename(cwd) === 'node_modules'? cwd : path.join(cwd, 'node_modules');
10
+ for (const ent of fs.readdirSync(pth)) {
11
+ if (!ent.endsWith('.c') && !ent.endsWith('.cxx')) continue;
12
+ includes.push(path.join(pth, ent));
13
+ }
14
+ const FLAG = opt.compiler==='msvc'? '/I' : '-I';
15
+ console.log(includes.map(pth => `${FLAG}"${pth}"`).join(' ').trim());
16
+ }
17
+
18
+
19
+ // Run the help command, which displays usage information.
20
+ function runHelp() {
21
+ console.error(
22
+ `Usage: cpoach [command] [options]\n` +
23
+ `\n` +
24
+ `Commands:\n` +
25
+ ` i | includes Generate compiler flags for include paths.\n` +
26
+ `\n` +
27
+ `Options:\n` +
28
+ ` --compiler [name] Specify the compiler (msvc, gcc, clang). Default is gcc.\n` +
29
+ ` --msvc Shortcut for --compiler msvc.\n` +
30
+ ` --gcc Shortcut for --compiler gcc.\n` +
31
+ ` --clang Shortcut for --compiler clang.\n`
32
+ );
33
+ }
34
+
35
+
36
+ // Parse the command name.
37
+ function parseCommand(opt, cmd) {
38
+ if (/i|includes/.test(cmd)) opt.command = 'includes';
39
+ else opt.error = `Unknown option: ${cmd}`;
40
+ }
41
+
42
+ // Parse a single command-line argument.
43
+ function parseArg(opt, argv, k, i) {
44
+ if (k==='--help') opt.help = true;
45
+ else if (k==='--compiler') opt.compiler = argv[++i];
46
+ else if (k==='--msvc') opt.compiler = 'msvc';
47
+ else if (k==='--gcc') opt.compiler = 'gcc';
48
+ else if (k==='--clang') opt.compiler = 'clang';
49
+ else if (!opt.command) parseCommand(opt, k);
50
+ else opt.error = `Unknown option: ${k}`;
51
+ return i;
52
+ }
53
+
54
+ // Parse command-line arguments.
55
+ function parseArgs(argv) {
56
+ const opt = {
57
+ error: null,
58
+ help: false,
59
+ command: 'includes',
60
+ compiler: 'gcc'
61
+ };
62
+ for (let i=2; i<argv.length; i++)
63
+ i = parseArg(opt, argv, argv[i], i);
64
+ return opt;
65
+ }
66
+
67
+
68
+ // Main entry point.
69
+ function main(argv) {
70
+ const opt = parseArgs(argv);
71
+ if (opt.error) {
72
+ console.error(opt.error + '\n');
73
+ console.error('Use "cpoach --help" for usage information.');
74
+ process.exit(1);
75
+ }
76
+ if (opt.help) {
77
+ runHelp();
78
+ process.exit(0);
79
+ }
80
+ switch (opt.command) {
81
+ case 'includes': runIncludes(opt); break;
82
+ default:
83
+ console.error(`Unknown command: ${opt.command}`);
84
+ process.exit(1);
85
+ }
86
+ }
87
+
88
+ // Run the main entry point.
89
+ main(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cpoach.sh",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Support tool for for easy-to-use, C/C++ libraries that can be effortlessly installed via NPM.",
5
5
  "keywords": [
6
6
  "c",