{"_id":"f-chat.io","_rev":"4-fe6273762ad258c5d1db1464bc361ba9","name":"f-chat.io","description":"Client library for using the F-Chat protocol (https://wiki.f-list.net/F-Chat_Protocol) the \"node-js\" way.","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"f-chat.io","version":"0.1.0","description":"Client library for using the F-Chat protocol (https://wiki.f-list.net/F-Chat_Protocol) the \"node-js\" way.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["f-chat","f-list","protocol","client"],"author":{"name":"Quentin Husky","email":"qthusk@gmail.com"},"repository":{"type":"git","url":"https://github.com/qthusk/f-chat.io"},"bugs":{"url":"https://github.com/qthusk/f-chat.io/issues"},"license":"GPLv3","dependencies":{"request":"^2.55.0","ws":"^0.7.2"},"devDependencies":{},"directories":["doc","lib"],"gitHead":"3e9ac4dbefcf7d9dad464e29fdd2262eee1cf82e","homepage":"https://github.com/qthusk/f-chat.io","_id":"f-chat.io@0.1.0","_shasum":"5b64225e14fc2bb2770dc54ec7031eb19f60241f","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"qthusk","email":"qthusk@gmail.com"},"dist":{"shasum":"5b64225e14fc2bb2770dc54ec7031eb19f60241f","tarball":"https://registry.npmjs.org/f-chat.io/-/f-chat.io-0.1.0.tgz","integrity":"sha512-gFcnYa+5x+r69zPVPHbhQoLzWduyXQkxxjVTvt239rGg3LmtUWHPMWZqRmEoGjY5NqYpjut5fSIYbpTTLDTUsg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDecIiCzsYqNsuwxtt3kSWpHCiKavynuZ/H0ooR1Jn/DAiEAhzAB1pjarXbSzHhM/vguTWwdEH1XVYq30XCMbqYTx+I="}]},"maintainers":[{"name":"qthusk","email":"qthusk@gmail.com"}]},"0.1.1":{"name":"f-chat.io","version":"0.1.1","description":"Client library for using the F-Chat protocol (https://wiki.f-list.net/F-Chat_Protocol) the \"node-js\" way.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["f-chat","f-list","protocol","client"],"author":{"name":"Quentin Husky","email":"qthusk@gmail.com"},"repository":{"type":"git","url":"https://github.com/qthusk/f-chat.io"},"bugs":{"url":"https://github.com/qthusk/f-chat.io/issues"},"license":"GPLv3","dependencies":{"request":"^2.55.0","underscore":"^1.8.3","ws":"^0.7.2"},"devDependencies":{},"directories":["doc","lib"],"gitHead":"0ad0b232208f1caf64914ca9de81a681a7957720","homepage":"https://github.com/qthusk/f-chat.io","_id":"f-chat.io@0.1.1","_shasum":"88928bd814f51be1a27e6599eaef42a9941c7b07","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"qthusk","email":"qthusk@gmail.com"},"dist":{"shasum":"88928bd814f51be1a27e6599eaef42a9941c7b07","tarball":"https://registry.npmjs.org/f-chat.io/-/f-chat.io-0.1.1.tgz","integrity":"sha512-1CrQm7fI91Vfml2TRbnGb18K8wJ+3LpKbpejl/XH0l9tiXq7nwtcnFoSKWmjMQPBvncAUeXt44T5YuD6b1hJog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqf3W1m5M0lkG5kBxNpeAfDjAtU3ALxoEjFScQVdPTgAIgIH3k4SE1Ry9VR32JdNsPc9lHSk3y4yV517Ikqtnr2f0="}]},"maintainers":[{"name":"qthusk","email":"qthusk@gmail.com"}]}},"readme":"# F-Chat.IO\r\n\r\n[![Current package version](https://img.shields.io/npm/v/f-chat.io.svg)](https://www.npmjs.com/package/f-chat.io)\r\n[![Package license](https://img.shields.io/npm/l/f-chat.io.svg)](https://www.npmjs.com/package/f-chat.io)\r\n[![Package downloads per month](https://img.shields.io/npm/dm/f-chat.io.svg)](https://www.npmjs.com/package/f-chat.io)\r\n\r\n## Install\r\n```sh\r\n$ npm install f-chat.io\r\n```\r\n\r\n## Usage\r\n\r\nBy default, the FChatClient class uses wss://chat.f-list.net:8799 as URL.\r\n\r\n### Example:\r\n```js\r\n'use strict';\r\n\r\nvar FChatClient = require('f-chat.io').FChatClient;\r\n\r\n\r\n// Your F-List credentials\r\nvar fChatAccount = 'foo-user', fChatPassword = 'bar-pass';\r\n\r\n// Client options\r\nvar options = { cname: 'foo-bar client', cversion: '1.0.0' };\r\n\r\n// Create a new F-Chat client object\r\nvar fchat = new FChatClient(options);\r\n\r\n\r\n// Handle any errors that may arise\r\nfchat.on('error', function(err) {\r\n  console.log('[Error]: ' + err);\r\n});\r\n\r\n// WebSocket connection established\r\nfchat.on('connected', function() {\r\n  console.log('Client connected');\r\n\r\n  // Something caused the WebSocket to disconnect\r\n  fchat.on('disconnected', function() {\r\n    console.log('Client disconnected');\r\n  });\r\n\r\n  // Got API ticket from https://www.f-list.net/json/getApiTicket.php\r\n  fchat.on('ticket', function(err, data) {\r\n    if (!err) {\r\n      console.log('Requested ticket: ' + data.ticket);\r\n    }\r\n  });\r\n\r\n  // Got IDN from server, after automatically sending IDN from client\r\n  fchat.on('identified', function(err, data) {\r\n    if (!err) {\r\n      console.log('Identified as character: ' + data.character);\r\n    }\r\n  });\r\n\r\n  // Raw commands, that got successfully parsed from any\r\n  // message the WebSocket client got from the server\r\n  fchat.on('raw', function(err, command) {\r\n    if (!err) {\r\n      console.log('>> [' + command.id + '] -> ' + JSON.stringify(command.args));\r\n    }\r\n  });\r\n\r\n  // Any of the commands listed here https://wiki.f-list.net/FChat_server_commands\r\n  // that got successfully parsed by the FChatClient object's parse(...) method\r\n  // should trigger events with the same three-character names listed on the\r\n  // wiki, e.g. the \"PIN\" command:\r\n  fchat.on('PIN', function(err, args) {\r\n    console.log('Recieved PING from server, but won\\'t respond to it, ' +\r\n                'as this is our call to disconnect. Cheerio!');\r\n    fchat.disconnect();\r\n  });\r\n});\r\n\r\n// Default character for your F-List account will be chosen.\r\n// Should you want to connect as a specific character, provide\r\n// it as the third parameter like this: { character: <characterName> }\r\nfchat.connect(fChatAccount, fChatPassword);\r\n```\r\n\r\nThe full signature of FChatClient.connect(...) is\r\n\r\n```js\r\nFChatClient.connect(<account>, <credentials>, <options>);\r\n```\r\n\r\n<options> is a JS object which can contain the following keys and values:\r\n```js\r\n{\r\n    autoPing:             <boolean> // [true] -> automatically respond with\r\n                                    // a client-'PIN' to a server-'PIN'.\r\n                                    //\r\n                                    // With 'autoPing' set to [true], an\r\n                                    // additional 'ping' event is emitted\r\n                                    // every time the client-'PIN' was\r\n                                    // successfuly send.\r\n                                    //\r\n                                    // Not responding with a client-'PIN'\r\n                                    // command in time, will trigger a\r\n                                    // disconnect after a few further\r\n                                    // server-'PIN' commands.\r\n\r\n  , character:            <string>  // Name of the F-List character to join\r\n                                    // the chat as.\r\n\r\n  , ticketAsCredentials:  <boolean> // [true] -> <credentials> contains a\r\n                                    // valid ticket instead of the account's\r\n                                    // password.\r\n}\r\n```\r\n\r\n\r\n## Documentation\r\n\r\nPersonal ToDo for the next days/weeks ...\r\n","maintainers":[{"name":"qthusk","email":"qthusk@gmail.com"}],"time":{"modified":"2022-06-17T23:07:26.909Z","created":"2015-05-29T19:40:55.118Z","0.1.0":"2015-05-29T19:40:55.118Z","0.1.1":"2015-05-31T20:35:24.749Z"},"homepage":"https://github.com/qthusk/f-chat.io","keywords":["f-chat","f-list","protocol","client"],"repository":{"type":"git","url":"https://github.com/qthusk/f-chat.io"},"author":{"name":"Quentin Husky","email":"qthusk@gmail.com"},"bugs":{"url":"https://github.com/qthusk/f-chat.io/issues"},"license":"GPLv3","readmeFilename":"README.md"}