Cassie (short for lil’ Cassandra) is a deliciously short Future library for JavaScript. It provides a simple Promise object that can be used as a placeholder for the return value of any asynchronous call.
In short: It helps you write readable code!
|
|
If you’re using Node.js (or Browserify to manage your scripts dependencies — which I highly recommend), you’ll want to grab Cassie from the NPM registry:
$ npm install cassie
Otherwise, if you’re suffering in the Browser without a module packaging system, you can include the whole Cassie + Browserify bundle — this contains Browserify, Cassie and all other dependencies — minus es5-shim, you’ll need to include that if you’re supporting older browsers:
<script src="/path/to/cassie.bundle.js"></script>
<script>
var cassie = require('cassie')
</script>
If you’re running Node.js or Browserify, you can just require it away on your scripts, all dependencies are managed for you:
var cassie = require('cassie')
Cassie should support all ECMAScript 5-compliant platforms. It’s been successfully tested in the following ones:
For the legacy platforms (like IE’s JScript), you’ll have to provide support for the following methods:
- Object.keys
- Object.create
- Object.getPrototypeOf
- Array.prototype.forEach
- Array.prototype.filter
- Array.prototype.indexOf
The nice es5-shim library takes care of handling all of those for you.
Cassie uses the Github tracker for tracking bugs and new features.
Cassie is licensed under the delicious and premissive MIT licence. You can happily copy, share, modify, sell or whatever — refer to the actual licence text for less information:
$ less LICENCE.txt
# The MIT License
#
# Copyright (c) 2011 Quildreen Motta <http://killdream.github.com/>
#
# 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.
(END)