Comparing version 3.0.0 to 4.0.0
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. |
{ | ||
"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": [ |
![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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 8 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3735030
169
44616
13
17
43
2
9
+ Addedbackbone@^1.1.2
+ Addedbootstrap@^3.3.1
+ Addedchance@^0.7.0
+ Addedhbsfy@^2.2.0
+ Addedjquery@^2.1.1
+ Addedjson-markup@^0.1.6
+ Addedlodash@^2.4.1
+ Addedmoment@^2.8.4
+ Addedzeroclipboard@^2.1.6
+ Addedbackbone@1.6.0(transitive)
+ Addedbootstrap@3.4.1(transitive)
+ Addedchance@0.7.7(transitive)
+ Addedhbsfy@2.8.1(transitive)
+ Addedjquery@2.2.4(transitive)
+ Addedjson-markup@0.1.7(transitive)
+ Addedlodash@2.4.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedunderscore@1.13.7(transitive)
+ Addedxtend@3.0.0(transitive)
+ Addedzeroclipboard@2.3.0(transitive)