Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Typesafe node.js for Haxe

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 autobuild
Octocat-spinner-32 examples
Octocat-spinner-32 src
Octocat-spinner-32 tinkerbell @ 8524fd6
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 Readme.md
Readme.md

noxe

noxe is a fully type-safe node.js wrapper for Haxe. The API is close to the node.js API as possible, while trying to type safe as possible.

Current state

This repository should be considered as alpha quality. It does not contain all node modules and not everything is properly tested. The missing modules will be added one after another, but if you need something feel free to add it on your own (The autobuild folder contains some helper scripts) or let us know.

Planned features

  • Add missing node modules
  • More documentation
  • Tools for compiling and integration of npm
  • Wrap node.js/noxe API into Haxe API to make it more compatible, e.g Buffer -> haxe.io.Bytes(Data), Streams -> haxe.io.Input/Output

Quickstart

A simple "Hello World" HTTP Server:

package;
class Test {
    static function main() {
        noxe.http.HTTP.createServer(function(request, response) {
            response.writeHead(200, {'Content-Type': 'text/plain'});
            response.writeString('Hello World\n');
            response.end();
        }).listen(3000, "localhost");
        Console.log("Server running at http://127.0.0.1:3000");
    }
}

If you are not familiar with the node.js API: node.js API Documentation

Examples

This repository ships with 5 simple examples:

  1. A simple webserver which just responds with "Hello World"
  2. A simple webserver which serves files from the "www" subdirectory
  3. A simple webserver which just responds with "Hello World", but this time using events instead of callbacks
  4. An example how to use EventEmitter for custom events
  5. A TCP server which response with what you send him (use telnet to test)

Prepare to use/test

Make sure you have the tinkerbell git submodule checked out.

git submodule update --init --recursive

Noxe currently does not work with tinkerbell from haxelib so you need to use the one from the repository. When using noxe make sure you have the noxe/src and the noxe/tinkerbell/src in your classpath.

This repository is tested with:

  • Haxe 2.10
  • node.js 0.6.19 (but should work with node.js > 0.6.3)
Something went wrong with that request. Please try again.