Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramongebben/tv_check
Check if a useragent is from a television
https://github.com/ramongebben/tv_check
Last synced: about 1 month ago
JSON representation
Check if a useragent is from a television
- Host: GitHub
- URL: https://github.com/ramongebben/tv_check
- Owner: RamonGebben
- License: mit
- Created: 2015-02-28T14:57:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-28T19:35:31.000Z (almost 10 years ago)
- Last Synced: 2024-09-24T15:49:49.808Z (3 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TV Check
A simple package to check if a requested browser is a television.
## Why?
I was working on a web application that needed act differently on television.
To my surprise there wasn't anything simple enough out there yet. That is why I decided to make this and put in in npm.## How?
### Install
To install just run
```bash
npm install tv_check --save
```### Usage
By example with express
```javascript
var tvCheck = require('tv_check');
var express = require('express');
var app = express();app.get('/', function( req, res ){
if( tvCheck.check( req ) === false ){
// Normal code ...
} else{
// Television code ...
};
});```
## Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request### Tests
We are using [mocha](http://mochajs.org/) for test.
To test just run```bash
npm test
# or
make test
```## License
This package is under [MIT License](https://github.com/RamonGebben/tv_check/blob/master/LICENSE)