|
1 | | -# Node++ |
| 1 | +# Nodepp |
2 | 2 |
|
3 | | -**Node++** is an innovative open source project that aims to make it easier to create applications in **C++**. This project introduces a high-level abstraction layer that allows developers to write **C++** code in a way that is similar to how they would write code in **NodeJS**. With **Node++**, developers can leverage the advantages of the **C++** language while benefiting from the ease of use and flexibility that **NodeJS** offers. This unique combination of features makes **Node++** a powerful tool for creating high-performance and scalable applications. Additionally, since it is an open source project, anyone can contribute and improve **Node++** to fit their specific needs. |
| 3 | +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. |
4 | 4 |
|
5 | | -- **uNode++:** compatible with embed devices [here](https://github.com/EDBCREPO/uNODEPP) |
6 | | -- **Node++:** compatible with PC and esp32 [here](https://github.com/EDBCREPO/NODEPP) |
| 5 | +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! |
7 | 6 |
|
8 | 7 | ## Dependencies |
9 | | -- Openssl `sudo apt install libssl-dev` |
10 | | -- Zlib `sudo apt install zlib1g-dev` |
| 8 | +```bash |
| 9 | +# Openssl |
| 10 | + 🪟: pacman -S mingw-w64-ucrt-x86_64-openssl |
| 11 | + 🐧: sudo apt install libssl-dev |
| 12 | + |
| 13 | +# Zlib |
| 14 | + 🪟: pacman -S mingw-w64-ucrt-x86_64-zlib |
| 15 | + 🐧: sudo apt install zlib1g-dev |
| 16 | +``` |
| 17 | + |
| 18 | +## Features |
11 | 19 |
|
12 | | -## Key Features |
| 20 | +- 📌: **Node.js-like API:** Write C++ code in a syntax and structure similar to Node.js, making it easier to learn and use. |
| 21 | +- 📌: **High-performance:** Leverage the speed and efficiency of C++ for demanding applications. |
| 22 | +- 📌: **Scalability:** Build applications that can handle large workloads and grow with your needs. |
| 23 | +- 📌: **Open-source:** Contribute to the project's development and customize it to your specific requirements. |
13 | 24 |
|
14 | | -- Allows writing C++ code as if writing in NodeJS |
15 | | -- Adds a high-level abstraction layer to simplify C++ application development |
16 | | -- Includes an event loop that can handle multiple events and tasks on a single thread of execution |
17 | | -- Supports coroutines, which allows running multiple tasks concurrently on a single thread |
18 | | -- Includes support for TCP, TLS, UDP, HTTP, and HTTPS, making it easy to create networked applications |
19 | | -- Includes a regular expression engine for processing and manipulating text strings |
20 | | -- Compatible with several platforms, including Windows, macOS, Linux, ESP32, and ESP8266 |
21 | | -- Open source project, meaning anyone can contribute and improve it |
22 | | -- Has extensive documentation and an active community of developers willing to help |
| 25 | +## Bateries Included |
23 | 26 |
|
24 | | -## Installation |
| 27 | +- 📌: Include a **build-in JSON** parser / stringify system. |
| 28 | +- 📌: Include a **build-in RegExp** engine for processing text strings. |
| 29 | +- 📌: Include Support for **UTF** manipulation | **UTF8 - UTF16 - UTF32** |
| 30 | +- 📌: Include a **build-in System** that make every object **Async Task** safety. |
| 31 | +- 📌: Include a **Smart Pointer** base **Garbage Collector** to avoid **Memory Leaks**. |
| 32 | +- 📌: Include support for **Reactive Programming** based on **Events** and **Observers**. |
| 33 | +- 📌: Include an **Event Loop** that can handle multiple events and tasks on a single thread. |
| 34 | +- 📌: Include support for **TCP | TLS | UDP | HTTP | WS** making it easy to create networked applications. |
| 35 | +- 📌: Include Support for **Poll | Epoll | Kqueue | WSAPoll** making it easy to handle multiple file descriptors. |
25 | 36 |
|
| 37 | +## Build & Run |
26 | 38 | ```bash |
27 | | - g++ -o main main.cpp -I ./include ; ./main |
| 39 | +🐧: g++ -o main main.cpp -I ./include ; ./main |
| 40 | +🪟: g++ -o main main.cpp -I ./include -lws2_32 ; ./main |
28 | 41 | ``` |
29 | 42 |
|
30 | | -## Usage |
| 43 | +## Examples |
| 44 | +### Hello world |
| 45 | +```cpp |
| 46 | +#include <nodepp/nodepp.h> |
| 47 | + |
| 48 | +using namespace nodepp; |
31 | 49 |
|
32 | | -To use **Node++**, simply include the `node++.h` header file in your project and start writing **C++** code as if you were writing in **NodeJS**. Here's a simple example: |
| 50 | +void onMain() { |
| 51 | + console::log("Hello World!"); |
| 52 | +} |
33 | 53 |
|
| 54 | +// note that we are using onMain() instead of main() |
| 55 | +``` |
| 56 | + |
| 57 | +### HTTP Client |
34 | 58 | ```cpp |
35 | | - #include <node++/node++.h> |
| 59 | +#include <nodepp/nodepp.h> |
| 60 | +#include <nodepp/http.h> |
36 | 61 |
|
37 | | - using namespace nodepp; |
| 62 | +using namespace nodepp; |
38 | 63 |
|
39 | | - void _Ready() { |
40 | | - console::log("Hello World!"); |
41 | | - } |
| 64 | +void onMain(){ |
| 65 | + |
| 66 | + fetch_t args; |
| 67 | + args.method = "GET"; |
| 68 | + args.url = "http://www.google.com/"; |
| 69 | + args.headers = header_t({ |
| 70 | + { "Host", url::host(args.url) } |
| 71 | + }); |
| 72 | + |
| 73 | + http::fetch( args ) |
| 74 | + |
| 75 | + .then([]( http_t cli ){ |
| 76 | + console::log( stream::await( cli ) ); |
| 77 | + }) |
| 78 | + |
| 79 | + .fail([]( except_t err ){ |
| 80 | + console::error( err ); |
| 81 | + }); |
| 82 | + |
| 83 | +} |
42 | 84 | ``` |
43 | 85 |
|
44 | | -Examples - [here](https://github.com/EDBCREPO/NODEPP/tree/main/examples) |
| 86 | +### HTTP Server |
| 87 | +```cpp |
| 88 | +#include <nodepp/nodepp.h> |
| 89 | +#include <nodepp/http.h> |
| 90 | +#include <nodepp/date.h> |
| 91 | + |
| 92 | +using namespace nodepp; |
| 93 | + |
| 94 | +void onMain(){ |
| 95 | + |
| 96 | + auto server = http::server([=]( http_t cli ){ |
| 97 | + |
| 98 | + console::log( cli.path, cli.get_fd() ); |
| 99 | + |
| 100 | + cli.write_header( 200, header_t({ |
| 101 | + { "content-type", "text/html" } |
| 102 | + })); |
| 103 | + |
| 104 | + cli.write( date::fulltime() ); |
| 105 | + cli.close(); // optional | GC automaticaly close unused sockets |
| 106 | + |
| 107 | + }); |
| 108 | + |
| 109 | + server.listen( "localhost", 8000, [=]( socket_t server ){ |
| 110 | + console::log("server started at http://localhost:8000"); |
| 111 | + }); |
| 112 | + |
| 113 | +} |
| 114 | +``` |
| 115 | + |
| 116 | +### More Examples [here](https://github.com/NodeppOfficial/Nodepp/tree/main/examples) |
| 117 | + |
| 118 | +## Projects made with NodePP |
| 119 | +- 🔗: [Draw on your PC using your smartphone](https://github.com/ScreenDraw/PCDraw) |
| 120 | +- 🔗: [Simple multiplayer Game With Raylib](https://medium.com/@EDBCBlog/create-your-own-online-multiplayer-small-fast-and-fun-with-raylib-nodepp-and-websockets-190f5c174094) |
| 121 | +- 🔗: [Cursed Luna - A simple Raylib Game](https://github.com/EDBCREPO/Space-Shocker) |
| 122 | +- 🔗: [Smart Card Reader(Nodepp-Arduino)](https://github.com/EDBCREPO/emv-reader) |
| 123 | +- 🔗: [Serial Port arduino using Nodepp](https://github.com/EDBCREPO/Arduino_PC) |
| 124 | +- 🔗: [Simple Raylib Real-Time Chat](https://github.com/EDBCREPO/simple-raylib-websocket-chat) |
| 125 | +- 🔗: [Simple Bitget Trading Bot](https://github.com/EDBCREPO/simple-binance-bot-nodepp) |
| 126 | + |
| 127 | +Check out some articles on [Medium](https://medium.com/@EDBCBlog) |
| 128 | + |
| 129 | +## Compatibility |
| 130 | +- 🔗: [NodePP for Window | Linux | Mac | Bsd ](https://github.com/NodeppOfficial/nodepp) |
| 131 | +- 🔗: [NodePP for Arduino](https://github.com/NodeppOfficial/nodepp-arduino) |
| 132 | +- 🔗: [Nodepp for ESP32](https://github.com/NodeppOfficial/nodepp-ESPXX) |
| 133 | +- 🔗: [Nodepp for WASM](https://github.com/NodeppOfficial/nodepp-wasm) |
| 134 | + |
| 135 | +## Official Libraries for Nodepp |
| 136 | +- 🔗: [ExpressPP](https://github.com/NodeppOfficial/nodepp-express) -> Express equivalent for Nodepp |
| 137 | +- 🔗: [ApifyPP](https://github.com/NodeppOfficial/nodepp-apify) -> Socket.io equivalent for Nodepp |
| 138 | +- 🔗: [SerialPP](https://github.com/NodeppOfficial/nodepp-serial) -> Serial Port for Nodepp |
| 139 | +- 🔗: [Argon2](https://github.com/NodeppOfficial/nodepp-argon2) -> Argon2 for Nodepp |
| 140 | +- 🔗: [Torify](https://github.com/NodeppOfficial/nodepp-torify) -> HTTP|Ws over Tor |
| 141 | +- 🔗: [NginxPP](https://github.com/NodeppOfficial/nodepp-nginx) -> Reverse Proxy |
| 142 | +- 🔗: [InputPP](https://github.com/NodeppOfficial/nodepp-input) -> Fake Inputs |
| 143 | +- 🔗: [JWT](https://github.com/NodeppOfficial/nodepp-jwt) -> JSON Web Token |
| 144 | +- 🔗: [NmapPP](https://github.com/NodeppOfficial/nodepp-nmap) -> Scan IPs and Ports |
| 145 | +- 🔗: [Redis](https://github.com/NodeppOfficial/nodepp-redis) -> Redis Client for Nodepp |
| 146 | +- 🔗: [Sqlite](https://github.com/NodeppOfficial/nodepp-sqlite) -> Sqlite Client for Nodepp |
| 147 | +- 🔗: [MariaDB](https://github.com/NodeppOfficial/nodepp-mariadb) -> MariaDB Client for Nodepp |
| 148 | +- 🔗: [Postgres](https://github.com/NodeppOfficial/nodepp-postgres) -> Postgres Client for Nodepp |
45 | 149 |
|
46 | 150 | ## Contribution |
47 | 151 |
|
48 | | -If you want to contribute to **Node++**, you are welcome to do so! You can contribute in several ways: |
| 152 | +If you want to contribute to **Nodepp**, you are welcome to do so! You can contribute in several ways: |
| 153 | + |
| 154 | +- ☕ Buying me a Coffee |
| 155 | +- 📢 Reporting bugs and issues |
| 156 | +- 📝 Improving the documentation |
| 157 | +- 📌 Adding new features or improving existing ones |
| 158 | +- 🧪 Writing tests and ensuring compatibility with different platforms |
| 159 | +- 🔍 Before submitting a pull request, make sure to read the contribution guidelines. |
49 | 160 |
|
50 | | -- Improving the documentation |
51 | | -- Reporting bugs and issues |
52 | | -- Adding new features or improving existing ones |
53 | | -- Writing tests and ensuring compatibility with different platforms |
54 | | -- Before submitting a pull request, make sure to read the contribution guidelines. |
| 161 | +[](https://ko-fi.com/edbc_repo) |
55 | 162 |
|
56 | 163 | ## License |
57 | 164 |
|
58 | | -**Node++** is distributed under the MIT License. See the LICENSE file for more details. |
| 165 | +**Nodepp** is distributed under the MIT License. See the LICENSE file for more details. |
0 commit comments