mroosen / node-nntp

A deferred NNTP client in Node.JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NNTP

Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.

NPM version Build Status Code Climate

Installation

$ npm install node-nntp

Usage

Here is an example that fetches 100 articles from the php.doc of the news.php.net server:

var NNTP = require('nntp');

var nntp = new NNTP({host: 'news.php.net', port: 119, secure: false}),
    group;

nntp.connect(function (error, response) {
  if (error) {
    throw error;
  }

  nntp.group('php.doc.nl', function (error, receivedGroup) {

    nntp.overviewFormat(function (error, receivedFormat) {

      nntp.overview(receivedGroup.first + '-' + (parseInt(receivedGroup.first, 10) + 100), receivedFormat, function (error, receivedMessages) {
        console.log(receivedMessages);
      });
    });
  });
});

License

MIT, see LICENSE

About

A deferred NNTP client in Node.JS

License:MIT License


Languages

Language:JavaScript 100.0%