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

f-chat.io

v0.1.1

Published

Client library for using the F-Chat protocol (https://wiki.f-list.net/F-Chat_Protocol) the "node-js" way.

Downloads

7

Readme

F-Chat.IO

Current package version Package license Package downloads per month

Install

$ npm install f-chat.io

Usage

By default, the FChatClient class uses wss://chat.f-list.net:8799 as URL.

Example:

'use strict';

var FChatClient = require('f-chat.io').FChatClient;


// Your F-List credentials
var fChatAccount = 'foo-user', fChatPassword = 'bar-pass';

// Client options
var options = { cname: 'foo-bar client', cversion: '1.0.0' };

// Create a new F-Chat client object
var fchat = new FChatClient(options);


// Handle any errors that may arise
fchat.on('error', function(err) {
  console.log('[Error]: ' + err);
});

// WebSocket connection established
fchat.on('connected', function() {
  console.log('Client connected');

  // Something caused the WebSocket to disconnect
  fchat.on('disconnected', function() {
    console.log('Client disconnected');
  });

  // Got API ticket from https://www.f-list.net/json/getApiTicket.php
  fchat.on('ticket', function(err, data) {
    if (!err) {
      console.log('Requested ticket: ' + data.ticket);
    }
  });

  // Got IDN from server, after automatically sending IDN from client
  fchat.on('identified', function(err, data) {
    if (!err) {
      console.log('Identified as character: ' + data.character);
    }
  });

  // Raw commands, that got successfully parsed from any
  // message the WebSocket client got from the server
  fchat.on('raw', function(err, command) {
    if (!err) {
      console.log('>> [' + command.id + '] -> ' + JSON.stringify(command.args));
    }
  });

  // Any of the commands listed here https://wiki.f-list.net/FChat_server_commands
  // that got successfully parsed by the FChatClient object's parse(...) method
  // should trigger events with the same three-character names listed on the
  // wiki, e.g. the "PIN" command:
  fchat.on('PIN', function(err, args) {
    console.log('Recieved PING from server, but won\'t respond to it, ' +
                'as this is our call to disconnect. Cheerio!');
    fchat.disconnect();
  });
});

// Default character for your F-List account will be chosen.
// Should you want to connect as a specific character, provide
// it as the third parameter like this: { character: <characterName> }
fchat.connect(fChatAccount, fChatPassword);

The full signature of FChatClient.connect(...) is

FChatClient.connect(<account>, <credentials>, <options>);

is a JS object which can contain the following keys and values:

{
    autoPing:             <boolean> // [true] -> automatically respond with
                                    // a client-'PIN' to a server-'PIN'.
                                    //
                                    // With 'autoPing' set to [true], an
                                    // additional 'ping' event is emitted
                                    // every time the client-'PIN' was
                                    // successfuly send.
                                    //
                                    // Not responding with a client-'PIN'
                                    // command in time, will trigger a
                                    // disconnect after a few further
                                    // server-'PIN' commands.

  , character:            <string>  // Name of the F-List character to join
                                    // the chat as.

  , ticketAsCredentials:  <boolean> // [true] -> <credentials> contains a
                                    // valid ticket instead of the account's
                                    // password.
}

Documentation

Personal ToDo for the next days/weeks ...