npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nntp-server

v3.1.0

Published

NNTP server implementation.

Downloads

98

Readme

nntp-server

CI NPM version Coverage Status

NNTP server for readers.

Demo: news://dev.nodeca.com

This project is intended to build NNTP interface for internet forums and similars.

  • It implements all commands, required by popular usenet newsreaders.
  • It implements commands pipelining to reduce responses latency.
  • You should only add database access methods and output templates.

Install

npm install nntp-server --save

API

Until better docs/examples provided, we sugget

  1. Dig nntp-server source. You should override all ._* methods (via monkeypatching or subclassing). All data in/out described in each method header.
  2. See tests for more examples.

new nntp-server(address, options)

const Server = require('nntp-server');
const nntp = new Server('nntp://localhost', { requireAuth: true });

Address has "standard" format to define everything in one string: nttp(s)://hostname:port/?option1=value1&option2=value2. For example:

  • nntp://example.com - listen on 119 port
  • nntps://example.com - listen on 563 port, encrypted

options:

  • key - tls secret key, optional.
  • cert - tls cert, optional.
  • pfx - tls key+cert together, optional.
  • requireAuth (false) - set true if user should be authenticated.
  • secure - "false" for nntp://, "true" for nntps://. Set true if you use nntp:// with external SSL proxy and connection is secure. If connection is not secure client will be requested to upgrade via STARTTLS after AUTHINFO command.
  • session - override default Session class if needed, optional.
  • commands - your own configuration of supported commands, optional. For example you may wish to drop AUTHINFO commands, been enabled by default.

.listen(address) -> Promise

Bind server to given addres, format is protocol://host[:port]:

  • 'nntps://localhost' - bind to 127.0.0.1:563 via SSL/TLS
  • 'nntp://localhost' - bind to 127.0.0.1:119 without encryption.

Returns Promise, resolved on success or fail.

.close() -> Promise

Stop accepting new connections and wait until existing ones will be finished.

Bind server to given addres, format is protocol://host[:port]:

  • 'nntps://localhost' - bind to 127.0.0.1:563 via SSL/TLS
  • 'nntp://localhost' - bind to 127.0.0.1:119 without encryption.

Returns Promise, resolved on success or fail.

exports.commands

{
  'LIST OVERVIEW.FMT': ...,
  'XOVER': ...,
  ...
}

Object with command configurations. Use it to create your own and apply modifications. Don't forget to clone objects prior to modify. Keep default ones immutable.

exports.Session

This class contains client connection logic. Probably, you will not need to extend it.