parrotjs

1.2.0 • Public • Published

parrot

Parrot

Gitter Dependency status Dev Dependencies Status Gittip

Browsers are more modern than ever. You can know the battery of your laptop, vibrate your mobile or know your position. JavaScript (and browsers) are in everything and can do more things than you think.

On the other hand, the API of this news features are too primitive: the browsers just provide the minimal interface, and is necessary write a little code around it. Also, each browser have specific vendor and exist minimal changes in the way to access a this methods.

Parrot is a high-level wrapper for browser features: It's provide you concise methods for use this features today.

Install

For install the library use bower:

$ bower install parrotjs
$ bower install parrot-module-device

You need always install parrotjs core and later the modules that you want to use.

Modules

One of the most important thing in parrot is that the design of code is modular, and you can only use the wrappers that you need. This is very nice for use the minimum code in different projects. All code is minifier and prepare for production.

When you are programming for the frontend side, each line of code is importat. The core of parrot provide you a facade for the DOM handler (jQuery, QuoJS or Zepto) and useful helpers methods to use across the module, but nothing more.

Name Description
parrot This repository and have the basic code provide DOM Handler and other minimal things.
parrot-boilerplate If you want to create a parrot-module, clone this repository and you have the standard scaffold and pre-configuration for do it.
parrot-module-ajax Make easy do AJAX petitions with different backend. Using with URL module for better experience.
parrot-module-url URL Management with support for different environments (testing, production, development,...). Use with AJAX for better experience.
parrot-module-storage Provides a uniformly API for management localStorage and SessionStorage.
parrot-module-notification Interact with HTML5 Notifications. It makes easy to reuse notifications.
parrot-module-device Automatically detect your device and provide some useful information: vendor, screen properties, browser vendor and version,...
parrot-module-geolocation Using geolocation with guarantees to obtain a good approximation

Builds

We offers different builds depending on what you need

Standalone (without DOM Handler)

Just parrot code. You need to provide an DOM handler:

<script src="bower_components/parrotjs/dist/parrot.standalone.js"></script>

Standard (with QuoJS, jQuery or ZeptoJS as DOM Handler)

Parrot code + DOM Handler. We have 3 different builds:

<script src="bower_components/parrotjs/dist/parrot.quo.js"></script>
<script src="bower_components/parrotjs/dist/parrot.jquery.js"></script>
<script src="bower_components/parrotjs/dist/parrot.zepto.js"></script>

For use different modules, just chain the modules in your html:

<script src="bower_components/parrotjs/dist/parrot.quo.js"></script>
<script src="bower_components/parrot-module-device/dist/parrot.device.js"></script>

Remember that for production you can concatenate all files that you need in one creating a simple Gulp/Grunt task.

Documentation

This module provides the parrot namespace and the global methods that other modules need, which are not interesting for you.

parrot

.version

Returns the version of the library.

parrot.version
# => '0.11.27' 

.$

Returns the instance of the DOM handlers (QuoJS, jQuery or ZeptoJS)

parrot.$

.language

Returns the language detected in the browser.

parrot.language
# => 'en'

License

MIT © parrotjs

Package Sidebar

Install

npm i parrotjs

Weekly Downloads

2

Version

1.2.0

License

MIT

Last publish

Collaborators

  • kikobeats