Parse and serialise NNTP commands and responses with streams!
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
LICENSE.md
README.md
example-request.js
example-response.js
index.js
package.json

README.md

ennenn

Parse and serialise NNTP commands and responses with streams!

Overview

ennenn frees you from caring about protocol details and splitting messages with NNTP applications. It provides a streaming parser and serialiser for creating commands and responses.

Or at least it will. Right now it's a work in progress.

Installation

Available via npm:

$ npm install ennenn

Or via git:

$ git clone git://github.com/deoxxa/ennenn.git node_modules/ennenn

Usage

Also see example-response.js and example-request.js.

#!/usr/bin/env node

// Processing responses

var ennenn = require("ennenn");

// The callback passed into the ResponseParser constructor is automatically
// attached to the "response" event.
var parser = new ennenn.ResponseParser(function on_response(response) {
  console.log("[Response started] " + response.status_code + ": " + response.status_text);

  response.on("data", function on_data(chunk) {
    console.log("[Response data] " + chunk.length);
  });

  response.on("end", function on_end() {
    console.log("[Response ended]");
  });
});
#!/usr/bin/env node

// Processing requests

var ennenn = require("./index");

// Same deal here with on_request as for on_response on ResponseParser.
var parser = new ennenn.RequestParser(function on_request(request) {
  console.log("[Request] " + request.command + ": " + request.arguments.join(", "));
});

License

3-clause BSD. A copy is included with the source.

Contact