UNPKG

nodulator

Version:

Complete NodeJS Framework for Restfull APIs

84 lines (83 loc) 5.36 kB
{ "_args": [ [ { "name": "nodulator-socket", "raw": "nodulator-socket@file:./src/Modules/Nodulator-Socket", "rawSpec": "file:./src/Modules/Nodulator-Socket", "scope": null, "spec": "/home/fgreiner/prog/js/Nodulator/src/Modules/Nodulator-Socket", "type": "directory" }, "/home/fgreiner/prog/js/Nodulator" ] ], "_from": "src/Modules/Nodulator-Socket", "_id": "nodulator-socket@0.0.3", "_inCache": true, "_installable": true, "_location": "/nodulator-socket", "_phantomChildren": { "core-util-is": "1.0.2", "debug": "2.2.0", "inherits": "2.0.1", "isarray": "0.0.1", "methods": "1.1.2", "reduce-component": "1.0.1", "string_decoder": "0.10.31" }, "_requested": { "name": "nodulator-socket", "raw": "nodulator-socket@file:./src/Modules/Nodulator-Socket", "rawSpec": "file:./src/Modules/Nodulator-Socket", "scope": null, "spec": "/home/fgreiner/prog/js/Nodulator/src/Modules/Nodulator-Socket", "type": "directory" }, "_requiredBy": [ "/" ], "_resolved": "file:src/Modules/Nodulator-Socket", "_shasum": "2e409f1c08eda1283d27863b5b07e0caa866a943", "_shrinkwrap": null, "_spec": "nodulator-socket@file:./src/Modules/Nodulator-Socket", "_where": "/home/fgreiner/prog/js/Nodulator", "author": { "email": "greine_f@epitech.eu", "name": "Champii" }, "bugs": { "url": "https://github.com/Champii/Nodulator-Socket/issues" }, "dependencies": { "async": "^0.9.0", "cookie-parser": "*", "passport.socketio": "^3.6.0", "socket.io": "*", "supertest": "^0.15.0", "underscore": "^1.8.2" }, "description": "Nodulator-Socket", "devDependencies": { "coffee-script": "*", "mocha": "~2.0.1" }, "directories": { "test": "test" }, "homepage": "https://github.com/Champii/Nodulator-Socket#readme", "license": "0", "main": "index.coffee", "name": "nodulator-socket", "optionalDependencies": {}, "readme": "Nodulator-Socket\n================\n\nSocket.io module implementation for [Nodulator](https://github.com/Champii/Nodulator)\n\nMaster : [![Build Status](https://travis-ci.org/Champii/Nodulator-Socket.svg?branch=master)](https://travis-ci.org/Champii/Nodulator-Socket)\n\nDevelop: [![Build Status](https://travis-ci.org/Champii/Nodulator-Socket.svg?branch=develop)](https://travis-ci.org/Champii/Nodulator-Socket)\n\nNPM: [![npm version](https://badge.fury.io/js/nodulator-socket.svg)](http://badge.fury.io/js/nodulator-socket)\n\nReleased under [GPLv2](https://github.com/Champii/Nodulator-Socket/blob/master/LICENSE.txt)\n\n\n## Concept\n\nProvides server-side `socket.io` implementation for `Nodulator`\n\n___\n## Features\n\n- General implementation for `socket.io`\n- Room system\n- Link with `passport` session\n\n___\n## JumpTo\n\n- [Installation](#installation)\n- [Basics](#basics)\n- [Rooms](#rooms)\n- [Project Generation](#project-generation)\n- [TODO](#todo)\n- [Changelog](#changelog)\n\n___\n## Installation\n\nYou can automaticaly install `Nodulator` and `Nodulator-Socket` by running\n\n```\n$> sudo npm install -g Nodulator\n$> Nodulator install socket\n```\n\nOr you can just run `npm` :\n\n```\n$> npm install nodulator nodulator-socket\n```\n\n___\n## Basics\n\n```coffeescript\nNodulator = require 'nodulator'\nSocket = require 'nodulator-socket'\n\nNodulator.Use Socket\n```\n\nIt adds `Nodulator.Socket()` function that you can extend\n\nThis interface provides 2 methods to override :\n- `@OnConnect(socket)`\n- `@OnDisconnect(socket)`\n\n```coffeescript\nNodulator = require 'nodulator'\n\nclass Socket extends Nodulator.Socket()\n\n OnConnect: (socket) ->\n console.log 'Socket connected: ', socket\n\nSocket.Init()\n\nmodule.exports = Socket\n```\n\n___\n## Rooms\n\nEach time a `Resource` is initialized, it create a new room and place each new connecting sockets into it.\n\nThen it listen for every `Resource` events (new_{resource_name}, update_{resource_name}, delete_{resource_name}) and broadcast theses to the attached room (and so to each sockets)\n\n(See [Nodulator Bus](https://github.com/Champii/Nodulator#bus))\n\n___\n## Project Generation\n\nSee [Nodulator's project generation](https://github.com/Champii/Nodulator#project-generation)\n\nWhen calling `$> Nodulator init`, it will automaticaly create following structure if non-existant:\n\n```\nserver\n└─ sockets\n └─ index.coffee\n```\n\nThe `index.coffee` file is a pre-extended `Nodulator.Socket()` class\n\n___\n## TODO\n\n- Repair passport session and socket.io match system (passportSocketIO)\n- Provide a filter to apply permissions on specific resource room\n- Make sockets private channel and give them only user-related content instead of every event\n\n___\n## Changelog\n\nXX/XX/15: current\n - Added redis as default store for sessions\n\n\n03/01/15: v0.0.3\n - passport.socketio isnt loaded anymore if [Nodulator-Account](https://github.com/Champii/Nodulator-Account) module is missing.\n\n02/01/15: v0.0.2\n - Improved README\n\n30/12/14: v0.0.1\n - Initial commit\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/Champii/Nodulator-Socket.git" }, "scripts": { "test": "mocha --compilers coffee:coffee-script/register test" }, "version": "0.0.3" }