Skip to content

A runtime for writing reliable asynchronous applications with C++. Provides I/O, networking, scheduling, timers, ...

License

Notifications You must be signed in to change notification settings

NodeppOfficial/nodepp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nodepp

The DOOM of Async Frameworks: Write Once, Build Everywhere, Process Everything.

Build Status Platform MIT License

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.

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++.

πŸ”—: Nodepp The MOST Powerful Framework for Asynchronous Programming in C++

πŸ’‘ Featured Project: Asynchronous Enigma Machine

To showcase Nodepp for Arduino efficiency on "bare metal" hardware, we implemented a fully functional Enigma Machine on an Arduino Nano.

ezgif-7f4dec232396a556.mp4

Try it now: Enigma Machine Simulation

πŸ’‘ Featured Project: Duck Hunt VR (WASM Edition)

To showcase Nodepp for Web, 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.

ezgif-7a54260198ce48cc.mp4

Play it now: Duck Hunt VR on Itch.io

Dependencies & Cmake Integration

# Openssl
    πŸͺŸ: pacman -S mingw-w64-ucrt-x86_64-openssl
    🐧: sudo apt install libssl-dev
# Zlib
    πŸͺŸ: pacman -S mingw-w64-ucrt-x86_64-zlib
    🐧: sudo apt install zlib1g-dev
include(FetchContent)

FetchContent_Declare(
	nodepp
	GIT_REPOSITORY   https://github.com/NodeppOfficial/nodepp
	GIT_TAG          origin/main
	GIT_PROGRESS     ON
)
FetchContent_MakeAvailable(nodepp)

#[...]

target_link_libraries( #[...]
	PUBLIC nodepp #[...]
)

Features

  • πŸ“Œ: Lightweight: Minimal dependencies, making it ideal for IoT and embedded systems.
  • πŸ“Œ: Cross-Platform: Write once, run on Linux, Windows, Mac, Android, WASM and Arduino/ESP32.
  • πŸ“Œ: Memory Efficient: Custom ptr_t, queue_t, array_t and string_t primitives provide SSO (Small Stack Optimization) and zero-copy slicing.
  • πŸ“Œ: Scalability: Build applications that can handle large workloads and grow with your needs.
  • πŸ“Œ: Open-source: Contribute to the project's development and customize it to your specific requirements.

Projects made with NodePP

Check out some articles on Medium

Batteries Included

  • πŸ“Œ: UTF Support: Comprehensive manipulation for UTF8, UTF16, and UTF32.
  • πŸ“Œ: Networking: Native support for TCP, TLS, UDP, HTTP, and WebSockets.
  • πŸ“Œ: Built-in JSON & RegExp: Full parsing and text processing engines.
  • πŸ“Œ: I/O Multiplexing: Support for Poll, Epoll, Kqueue, and WSAPoll.
  • πŸ“Œ: Reactive Programming: Built-in Events and Observers system.

Quick Start

Clone The Repository

#!/usr/bin/env bash
git clone https://github.com/NodeppOfficial/nodepp ; cd nodepp

Create a main.cpp File

#!/usr/bin/env bash
touch main.cpp
#include <nodepp/nodepp.h>
#include <nodepp/regex.h>
#include <nodepp/http.h>
#include <nodepp/date.h>

using namespace nodepp;

void onMain(){

    auto server = http::server([=]( http_t cli ){

        cli.write_header( 200, header_t({
            { "content-type", "text/html" }
        }));

        cli.write( regex::format( R"(
            <h1> Hello World </h1>
            <h2> ${0} </h2>
        )", date::fulltime() ));

    });

    server.listen( "localhost", 8000, [=]( socket_t server ){
        console::log("server started at http://localhost:8000");
    });

}

Build Your Code

#!/usr/bin/env bash
🐧: g++ -o main main.cpp -O3 -I ./include          ; ./main #(Linux)
πŸͺŸ: g++ -o main main.cpp -O3 -I ./include -lws2_32 ; ./main #(Windows)

Nodepp Supports Other Platforms Too

Ecosystem

  • πŸ”—: ExpressPP -> Express equivalent for Nodepp
  • πŸ”—: ApifyPP -> Socket.io equivalent for Nodepp
  • πŸ”—: Bluetooth -> Bluetooth Port for Nodepp
  • πŸ”—: SerialPP -> Serial Port for Nodepp
  • πŸ”—: Argon2 -> Argon2 for Nodepp
  • πŸ”—: Torify -> HTTP|Ws over Tor
  • πŸ”—: GPUPP -> GPGPU for Nodepp
  • πŸ”—: NginxPP -> Reverse Proxy
  • πŸ”—: InputPP -> Fake Inputs
  • πŸ”—: XML -> XML for Nodepp
  • πŸ”—: JWT -> JSON Web Token
  • πŸ”—: NmapPP -> Scan IPs and Ports
  • πŸ”—: Redis -> Redis Client for Nodepp
  • πŸ”—: Sqlite -> Sqlite Client for Nodepp
  • πŸ”—: MariaDB -> MariaDB Client for Nodepp
  • πŸ”—: Postgres -> Postgres Client for Nodepp

Contribution

If you want to contribute to Nodepp, you are welcome to do so! You can contribute in several ways:

  • β˜• Buying me a Coffee
  • πŸ“’ Reporting bugs and issues
  • πŸ“ Improving the documentation
  • πŸ“Œ Adding new features or improving existing ones
  • πŸ§ͺ Writing tests and ensuring compatibility with different platforms
  • πŸ” Before submitting a pull request, make sure to read the contribution guidelines.

ko-fi

License

Nodepp is distributed under the MIT License. See the LICENSE file for more details.

About

A runtime for writing reliable asynchronous applications with C++. Provides I/O, networking, scheduling, timers, ...

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 5