55[ ![ Platform] ( https://img.shields.io/badge/platform-%20Linux%20|%20Windows%20|%20Mac%20|%20Android%20|%20IOS%20-blue )] ( https://github.com/NodeppOfficial/nodepp )
66[ ![ MIT License] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
77
8- Nodepp is a groundbreaking open-source project that simplifies C++ application development by bridging the gap between the language's raw power and the developer-friendly abstractions of Node.js. By providing a high-level API, Nodepp empowers developers to write C++ code in a familiar, Node.js-inspired style .
8+ Nodepp is a groundbreaking C++ framework that bridges the gap between the language's raw performance and the developer-friendly abstractions of Node.js. By providing a high-level, asynchronous API, Nodepp empowers you to write C++ with a familiar syntax—enabling seamless development across cloud servers, desktop apps, and microcontrollers .
99
10- One of the standout features of Nodepp is its 100% asynchronous architecture, powered by an internal Event Loop. This design efficiently manages Nodepp’s tasks, enabling you to develop scalable and concurrent applications with minimal code. Experience the power and flexibility of Nodepp as you streamline your development process and create robust applications effortlessly!
10+ At its core, Nodepp features a 100% asynchronous architecture powered by an internal Event Loop. This allows for massive concurrency and scalable task management with minimal code complexity, effectively bringing the "Write Once, Run Everywhere" philosophy to the world of high-performance C++.
1111
1212🔗: [ Nodepp The MOST Powerful Framework for Asynchronous Programming in C++] ( https://medium.com/p/c01b84eee67a )
1313
14+ ## 💡 Featured Project: Asynchronous Enigma Machine
15+
16+ To showcase [ Nodepp for Arduino] ( https://github.com/NodeppOfficial/nodepp-arduino ) efficiency on "bare metal" hardware, we implemented a fully functional Enigma Machine on an Arduino Nano.
17+
18+ https://github.com/user-attachments/assets/9b870671-3854-444f-893d-40fdce31a629
19+
20+ Try it now: [ Enigma Machine Simulation] ( https://wokwi.com/projects/449104127751150593 )
21+
22+ ## 💡 Featured Project: Duck Hunt VR (WASM Edition)
23+
24+ To showcase [ Nodepp for Web] ( https://github.com/NodeppOfficial/nodepp-wasm ) , we ported the classic Duck Hunt to Virtual Reality, running natively in the browser via WebAssembly. This project pushes the limits of web-based VR by combining low-level C++ performance with modern Web APIs.
25+
26+ https://github.com/user-attachments/assets/ab26287e-bd73-4ee8-941b-d97382e203c9
27+
28+ Play it now: [ Duck Hunt VR on Itch.io] ( https://edbcrepo.itch.io/duck-hunt-vr )
29+
1430## Dependencies & Cmake Integration
1531``` bash
1632# Openssl
@@ -40,8 +56,9 @@ target_link_libraries( #[...]
4056
4157## Features
4258
43- - 📌: ** Node.js-like API:** Write C++ code in a syntax and structure similar to Node.js, making it easier to learn and use.
44- - 📌: ** High-performance:** Leverage the speed and efficiency of C++ for demanding applications.
59+ - 📌: ** Lightweight:** Minimal dependencies, making it ideal for IoT and embedded systems.
60+ - 📌: ** Cross-Platform:** Write once, run on Linux, Windows, Mac, Android, WASM and Arduino/ESP32.
61+ - 📌: ** Memory Efficient:** Custom ` ptr_t ` , ` queue_t ` , ` array_t ` and ` string_t ` primitives provide SSO (Small Stack Optimization) and zero-copy slicing.
4562- 📌: ** Scalability:** Build applications that can handle large workloads and grow with your needs.
4663- 📌: ** Open-source:** Contribute to the project's development and customize it to your specific requirements.
4764
@@ -60,98 +77,28 @@ Check out some articles on [Medium](https://medium.com/@EDBCBlog)
6077
6178## Batteries Included
6279
63- - 📌: Include a ** build-in JSON** parser / stringify system.
64- - 📌: Include a ** build-in RegExp** engine for processing text strings.
65- - 📌: Include support for ** UTF** manipulation | ** UTF8 - UTF16 - UTF32**
66- - 📌: Include a ** build-in System** that make every object ** Async Task** safety.
67- - 📌: Include a ** Smart Pointer** base ** Garbage Collector** to avoid ** Memory Leaks** .
68- - 📌: Include support for ** Reactive Programming** based on ** Events** and ** Observers** .
69- - 📌: Include an ** Event Loop** that can handle multiple events and tasks on a single thread.
70- - 📌: Include support for ** TCP | TLS | UDP | HTTP | WS** making it easy to create networked applications.
71- - 📌: Include support for ** Poll | Epoll | Kqueue | WSAPoll** making it easy to handle multiple file descriptors.
72- - 📌: Include support for ** Worker isolated event-loop** making it easy to create distributed self-contained event-loops.
73-
74- ## Build & Run
75- ``` bash
76- 🐧: g++ -o main main.cpp -O3 -I ./include ; ./main
77- 🪟: g++ -o main main.cpp -O3 -I ./include -lws2_32 ; ./main
78- ```
79-
80- ## Test Unit
81- ``` bash
82- 🐧: ( cd ./test; g++ -o main main.cpp -I../include -lssl -lcrypto -lpthread ; ./main )
83- 🪟: ( cd ./test; g++ -o main main.cpp -I../include -lssl -lcrypto -lws2_32 ; ./main )
84- ```
85-
86- ## Examples
87-
88- ### Reading JSON
89- ``` cpp
90- #include < nodepp/nodepp.h>
91- #include < nodepp/json.h>
92-
93- using namespace nodepp ;
94-
95- void onMain () {
96-
97- auto data = json::parse( R"({
98- "var1": 10,
99- "var2": false,
100- "var3": "hello world",
101- "var4": { "var5": "nested object" },
102- "var5": [ 10, 20, 30, 40, 50, 60, 70 ]
103- })" );
104-
105- console::log ( "var1:", data[ "var1"] .as<uint >() );
106- console::log( "var2:", data[ "var2"] .as<bool >() );
107- console::log( "var3:", data[ "var3"] .as<string_t>() );
108- console::log( "var4:", data[ "var4"] [ "var5" ] .as<string_t>() );
109-
110- console::log ( "\n --- \n" );
80+ - 📌: UTF Support: Comprehensive manipulation for UTF8, UTF16, and UTF32.
81+ - 📌: Networking: Native support for TCP, TLS, UDP, HTTP, and WebSockets.
82+ - 📌: Built-in JSON & RegExp: Full parsing and text processing engines.
83+ - 📌: I/O Multiplexing: Support for Poll, Epoll, Kqueue, and WSAPoll.
84+ - 📌: Reactive Programming: Built-in Events and Observers system.
11185
112- for( auto x: data["var5"].as<array_t<object_t>>() ){
113- console::log ( "var5", x.as<uint >() );
114- }
86+ ## Quick Start
11587
116- }
88+ ### Clone The Repository
89+ ``` bash
90+ #! /usr/bin/env bash
91+ git clone https://github.com/NodeppOfficial/nodepp ; cd nodepp
11792```
11893
119- ### HTTP Client
120- ``` cpp
121- // #pragma comment(lib, "Ws2_32.lib") msvc compiler
122-
123- #include < nodepp/nodepp.h>
124- #include < nodepp/http.h>
125-
126- using namespace nodepp ;
127-
128- void onMain (){
129-
130- fetch_t args;
131- args.method = "GET";
132- args.url = "http://www.google.com/";
133- args.headers = header_t({
134- { "Host", url::host(args.url) }
135- });
136-
137- http::fetch ( args )
138-
139- .then([]( http_t cli ){
140- console::log ( stream::await ( cli ) );
141- })
142-
143- .fail([]( except_t err ){
144- console::error ( err );
145- });
146-
147- }
94+ ### Create a main.cpp File
95+ ``` bash
96+ #! /usr/bin/env bash
97+ touch main.cpp
14898```
149-
150- ### HTTP Server
15199``` cpp
152- // #pragma comment(lib, "Ws2_32.lib") msvc compiler
153-
154100#include < nodepp/nodepp.h>
101+ #include < nodepp/regex.h>
155102#include < nodepp/http.h>
156103#include < nodepp/date.h>
157104
@@ -161,14 +108,14 @@ void onMain(){
161108
162109 auto server = http::server([=]( http_t cli ){
163110
164- console::log ( cli.path, cli.get_fd() );
165-
166111 cli.write_header( 200, header_t({
167112 { "content-type", "text/html" }
168113 }));
169114
170- cli.write( date::fulltime() );
171- cli.close(); // optional
115+ cli.write( regex::format( R"(
116+ <h1> Hello World </h1>
117+ <h2> ${0} </h2>
118+ )", date::fulltime() ));
172119
173120 });
174121
@@ -179,72 +126,6 @@ void onMain(){
179126}
180127```
181128
182- ### Worker Isolated Event-Loop
183- ``` cpp
184- #include < nodepp/nodepp.h>
185- #include < nodepp/worker.h>
186- #include < nodepp/os.h>
187-
188- using namespace nodepp ;
189-
190- atomic_t <int > shared_variable = 100 ;
191-
192- void worker_main ( int cpu_id ){
193-
194- // this event-loop runs in it's own isolated worker-thread
195-
196- process::add( coroutine::add( COROUTINE(){
197- thread_local static int variable;
198- // this will create a static variable per thread
199- static atomic_t<int> shared_variable;
200- // this will create a shared global variable
201- int local_variable;
202- // this is a normal variable only exists here
203- coBegin
204-
205- while( shared_variable-->0 ){
206- console::log( cpu_id, "->", shared_variable.get() );
207- coDelay(1000); }
208-
209- coFinish
210- }));
211-
212- }
213-
214- void onMain(){
215-
216- for( auto x=os::cpus(); x-->0; ){ worker::add([=](){
217- worker_main( x ); process::wait();
218- return -1; }); }
219-
220- }
221- ```
222-
223- ### More Examples [here](https://nodeppofficial.github.io/nodepp-doc/guide.html)
224-
225- ## Installing Nodepp
226-
227- ### Clone The Repository
228- ```bash
229- #!/usr/bin/env bash
230- git clone https://github.com/NodeppOfficial/nodepp ; cd nodepp
231- ```
232-
233- ### Create a main.cpp File
234- ``` bash
235- #! /usr/bin/env bash
236- touch main.cpp
237- ```
238- ``` cpp
239- #include < nodepp/nodepp.h>
240-
241- using namespace nodepp ;
242-
243- void onMain () {
244- console::log ("Hello World!");
245- }
246- ```
247-
248129### Build Your Code
249130``` bash
250131#! /usr/bin/env bash
@@ -257,7 +138,7 @@ void onMain() {
257138- 🔗: [ NodePP for Arduino] ( https://github.com/NodeppOfficial/nodepp-arduino )
258139- 🔗: [ Nodepp for WASM] ( https://github.com/NodeppOfficial/nodepp-wasm )
259140
260- ## Official Libraries for Nodepp
141+ ## Ecosystem
261142- 🔗: [ ExpressPP] ( https://github.com/NodeppOfficial/nodepp-express ) -> Express equivalent for Nodepp
262143- 🔗: [ ApifyPP] ( https://github.com/NodeppOfficial/nodepp-apify ) -> Socket.io equivalent for Nodepp
263144- 🔗: [ Bluetooth] ( https://github.com/NodeppOfficial/nodepp-bluetooth ) -> Bluetooth Port for Nodepp
0 commit comments