Chaplin is an architecture for JavaScript applications using the Backbone.js library.
All information, commercial support contacts and examples are available at chaplinjs.org, comprehensive documentation and class reference can be found at docs.chaplinjs.org.
Download the latest release on chaplinjs.org. See below on how to compile from source manually.
The Chaplin source files are originally written in the CoffeeScript meta-language. However, the Chaplin library file is a compiled JavaScript file which defines the chaplin
module.
Our build script compiles the CoffeeScripts and bundles them into one file. To run the script, follow these steps:
-
Download and install Node.js.
-
Open a shell (aka terminal aka command prompt) and type in the commands in the following steps.
-
Install the Node package for the grunt command line interface globally.
sudo npm install -g grunt-cli
On Windows, you can omit the
sudo
command at the beginning. -
Change into the Chaplin root directory.
-
Start the build (will install dependencies and build).
npm install
This creates these files in build
dir:
chaplin.js
– The library as a compiled JavaScript file.chaplin.min.js
– Minified. For production use you should pick this.
Chaplin aims to be fully unit-tested. At the moment most of the modules are covered by Mocha tests.
How to run the tests:
-
Follow the steps for building chaplin.
-
Open a shell (aka terminal aka command prompt) and type in the commands in the following steps.
-
Change into the Chaplin root directory.
-
Start the test runner.
npm test
Note that you can now additionally open test/index.html
to run the tests in your browser (instead of in node).
Furthermore code coverage reports are generated and may be viewed by opening test/coverage/index.html
in your browser.