This package has been deprecated

Author message:

Deprecated as I don't use Titanium anymore

ti-os

1.0.1 • Public • Published

ti-os Build Status

Platform conditional utility for cross-platform Titanium apps

Install

In the Resources directory:

$ npm install --save ti-os

Usage

var os = require('node_modules/ti-os/index');
 
// use the properties for if statements
if (os.iphone) {
    console.log('Running on iPhone');
}
 
// and the method for inline conditionals
var win = Ti.UI.createWindow({
    title: os({
        iphone5: function () {
            return 'Yo iPhone 5';
        },
        ios: 'Yo iOS',
        default: 'Yo' // the rest of the platforms
    })
});

API

os(platform)

platform

Required
Type: object
Keys: iphone5, iphone, ipad, ios, android, default

default will be used if none of the platforms match.

Values can be a string or function. If it's a function it will be called.

os.iphone5

os.iphone

os.ipad

os.ios

os.android

License

MIT © Sindre Sorhus

Package Sidebar

Install

npm i ti-os

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.58 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus