Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tv

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tv - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

public/css/.gitkeep

15

CONTRIBUTING.md
Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
There are various npm run tasks that support the development process.
The notable task is `npm run start-dev`. This will build the assets,
run the tests, run the `examples/simple.js` hapi server, and watch for changes.
`npm install`
`npm run start-dev`
Navigate to [http://localhost:8000/debug/console](http://localhost:8000/debug/console) to see the TV debug console.
In a different browser window, navigate to [http://localhost:8000/](http://localhost:8000/) and
notice a 200 request rendered in TV.
Likewise, navigate to [http://localhost:8000/foo](http://localhost:8000/foo) and
notice a 404 request rendered in TV.

51

package.json
{
"name": "tv",
"description": "Interactive debug console plugin for hapi",
"version": "3.0.0",
"version": "4.0.0",
"repository": "git://github.com/hapijs/tv",

@@ -17,5 +17,14 @@ "main": "index",

"dependencies": {
"backbone": "^1.1.2",
"bootstrap": "^3.3.1",
"chance": "^0.7.0",
"handlebars": "2.0.x",
"hbsfy": "^2.2.0",
"hoek": "2.x.x",
"jquery": "^2.1.1",
"json-markup": "^0.1.6",
"lodash": "^2.4.1",
"moment": "^2.8.4",
"ws": "0.4.x",
"handlebars": "2.0.x"
"zeroclipboard": "^2.1.6"
},

@@ -26,8 +35,38 @@ "peerDependencies": {

"devDependencies": {
"code": "1.x.x",
"hapi": "8.x.x",
"lab": "5.x.x"
"browserify": "^6.3.2",
"browserify-istanbul": "^0.1.2",
"chai": "^1.10.0",
"chai-jquery": "^2.0.0",
"code": "^1.2.1",
"es5-shim": "^4.0.5",
"istanbul": "^0.3.5",
"lab": "5.x.x",
"mocha": "^2.0.1",
"mocha-phantomjs": "^3.5.2",
"node-sass": "^1.2.3",
"onchange": "0.0.2",
"phantomjs": "^1.9.12",
"sinon": "^1.12.1",
"sinon-chai": "^2.6.0",
"watchify": "^2.1.1",
"hapi": ">=8.x.x"
},
"scripts": {
"test": "make test-cov"
"test": "make test-client && make test-cov",
"test-client-cov": "npm run build-test && npm run test && istanbul report --root coverage lcov",
"watch-js": "watchify -t hbsfy -e source/js/app.js source/js/**/*.js -o public/js/main.js -d -v",
"watch-test": "watchify -t hbsfy -e test/client/main.js test/client/**/*.js -o test/bundle.js -d -v",
"watch-styles": "node-sass source/styles/style.scss public/css/style.css -w source/styles -r",
"watch": "npm run build && npm run watch-js & npm run watch-test & npm run watch-styles & npm run post-js",
"copy-fonts": "cp -R source/fonts/vendor/bootstrap/** public/fonts",
"copy-assets": "cp -R vendor/ZeroClipboard.swf public/js",
"build-js": "browserify -t hbsfy -e source/js/app.js source/js/**/*.js > public/js/main.js -d",
"build-test": "browserify -t hbsfy -t [ browserify-istanbul --ignore **/*.hbs ] test/client/main.js -o test/bundle.js",
"build-styles": "node-sass source/styles/style.scss public/css/style.css",
"build": "npm run build-js && npm run build-styles && npm run build-test && npm run copy-fonts && npm run copy-assets",
"boot": "node examples/simple.js",
"start": "npm run build && npm run boot",
"start-dev": "npm run watch & npm run boot",
"post-js": "onchange test/bundle.js -- npm run test",
"prepublish": "npm run build"
},

@@ -34,0 +73,0 @@ "licenses": [

33

README.md
![tv Logo](https://raw.github.com/spumko/tv/master/images/tv.png)
Interactive debug console plugin for [**hapi**](https://github.com/hapijs/hapi)
TV is an interactive debug console plugin for [**hapi**](https://github.com/hapijs/hapi)

@@ -9,6 +9,9 @@ [![Build Status](https://secure.travis-ci.org/hapijs/tv.png)](http://travis-ci.org/hapijs/tv)

The debug console is a simple web page in which developers can subscribe to a debug id (or * for all), and then include that
debug id as an extra query parameter with each request. The server will use WebSocket to stream the subscribed request logs to
the web page in real-time. To enable the debug console in a **hapi** application, install **tv** and require it using either the _'composer'_ configuration or with the _'plugin'_ interface. Below is an example of incuding **tv** using the _'pack'_ interface:
TV is a simple web page in which developers can view server logs for their requests. Optionally, they can also filter the server logs to just their requests by attaching a unique client id to each request. The server will use WebSocket to stream the logs to the web application in real-time.
### Using TV in Your Application
To enable TV in a **hapi** application, install **tv** and register it. Below is an example of registering the **tv** plugin:
```javascript

@@ -19,22 +22,18 @@ var Hapi = require('hapi');

var server = new Hapi.Server();
var options = {
endpoint: '/debug/console',
queryKey: 'debug'
};
server.pack.register({ plugin: Tv, options: options }, function (err) {
if (!err) {
server.start();
}
server.register(Tv, function (err) {
if (!err) {
server.start();
}
});
```
In applications using multiple server instances, only one server can enable the debug interface using the default port.
### Debug
The debug console is a simple web page in which developers can subscribe to a debug id, and then include that debug id as an extra query parameter in each
request. The server will use WebSockets to stream the subscribed request logs to the web page in real-time. In applications using multiple server instances,
only one server can enable the debug interface using the default port. Below are the options available to be passed into the **tv** plugin:
### Options
Below are the options available to be passed into the **tv** plugin:
- `host` - the hostname, IP address, or path to UNIX domain socket the WebSocket connection is bound to. Defaults to _undefined_ and therefore `0.0.0.0`

@@ -41,0 +40,0 @@ which means any available network interface(see hapi `new Server()`).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc