Git Product home page Git Product logo

beez-ua's Introduction

beez-ua

About

The library deside which browser has an access from UserAgent for node.js or browser. This library is Forked from zepto.js.

[INFO] This library supports only smartphone browser.
[WARN] UserAgent support are planning to do at any time.

npm install (basic)

$ npm install beez-ua

Installing from source code

$ git clone https://github.com/CyberAgent/beez-ua.git
$ cd beez-ua
$ npm install . # install deps lib

installed via npm from github

$ npm install https://github.com/CyberAgent/beez-ua.git

Release files

$ ll release
beez.ua.js (size: 8220 byte)[8.2kb] optimize none
beez.ua.min.js (size: 2957 byte)[2.9kb] optimize uglify2

example

$ node
> var beezua = require('beez-ua');
undefined

> beezua.VERSION
'0.4.7'
> beezua.setup('Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25')
undefined

> beezua. [tab*2]
beezua.__defineGetter__      beezua.__defineSetter__      beezua.__lookupGetter__      beezua.__lookupSetter__      beezua.constructor           beezua.hasOwnProperty
beezua.isPrototypeOf         beezua.propertyIsEnumerable  beezua.toLocaleString        beezua.toString              beezua.valueOf

beezua.VERSION               beezua.android               beezua.bb10                  beezua.blackberry            beezua.browser               beezua.chrome
beezua.ds                    beezua.firefox               beezua.ipad                  beezua.iphone                beezua.kindle                beezua.os
beezua.playbook              beezua.ps3                   beezua.psp                   beezua.psvita                beezua.rimtabletos           beezua.safari
beezua.setup                 beezua.silk                  beezua.touchpad              beezua.webkit                beezua.webos                 beezua.wii
beezua.windowsphone

> beezua.os
{ iphone: true,
  ios: true,
  version: '6.0',
  tablet: false,
  phone: true }
> beezua.browser
{ webkit: true, version: '536.26' }
> beezua.android
null
> beezua.iphone
[ 'iPhone OS 6_0',
  'iPhone OS',
  '6_0',
  index: 25,
  input: 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25' ]

Requirements

test (browser)

$ cd beez-ua/
$ open spec/index.html

test (node.js)

$ make test

build

$ make build

jshint

$ make jshint

jsdoc

$ make jsdoc
$ open ./docs/index.html

report plato

$ make test
./node_modules/mocha/bin/mocha test/test-*.js


  beez-ua
    ✓ window.nagigator.userAgent 
    ✓ ua.Android 2.x 
    ✓ ua.Android 3.x 
    ✓ ua.Android 4.x 
    ✓ ua.iphone (IOS4) 
    ✓ ua.iphone (IOS5) 
    ✓ ua.iphone (IOS6) 
    ✓ ua.iphone (IOS4-ipad) 
    ✓ ua.iphone (IOS5-ipad) 
    ✓ ua.iphone (IOS6-ipad) 
    ✓ ua.blackberry 
    ✓ ua.webos 
    ✓ ua.touchpad 
    ✓ ua.kindle 
    ✓ ua.silk 
    ✓ ua.bb10 
    ✓ ua.rimtabletos 
    ✓ ua.playbook 
    ✓ ua.ds 
    ✓ ua.psp 
    ✓ ua.psvita 
    ✓ ua.windowsphone 

  21 tests complete (15 ms)

Contributing

Reference Projects

Projects that incorporate some of the source code UserAgent zepto.js

Copyright

CyberAgent, Inc. All rights reserved.

LICENSE

@see : LICENSE

The MIT License (MIT)

Copyright © CyberAgent, Inc. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This library is forked from zepto.js that is MIT License

Bitdeli Badge

beez-ua's People

Contributors

bitdeli-chef avatar fkei avatar layzie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.