- ×Show All
Crossroads.js is a routing library inspired by URL Route/Dispatch utilities present on frameworks like Rails, Pyramid, Django, CakePHP, CodeIgniter, etc... It parses a string input and decides which action should be executed by matching the string against multiple patterns.
If used properly it can reduce code complexity by decoupling objects and also by abstracting navigation paths.
See project page for documentation and more details.
This library requires JS-Signals to work.
- crossroads.js : Uncompressed source code with comments.
- crossroads.min.js : Compressed code.
You can install Crossroads on Node.js using NPM
npm install crossroads
dev -> development files |- lib -> 3rd-party libraries |- src -> source files |- tests -> unit tests dist -> distribution files
master -> always contain code from the latest stable version release-** -> code canditate for the next stable version (alpha/beta) dev -> main development branch (nightly) gh-pages -> project page **other** -> features/hotfixes/experimental, probably non-stable code
Building your own
This project uses Node.js for the build process. If for some reason you need to build a custom version install Node.js and run:
This will delete all JS files inside the
distfolder, merge/update/compress source files and copy the output to the
distfolder always contain the latest version, regular users should not need to run build task.
Running unit tests
On the browser
dev/tests/spec_runner-dist.htmlon your browser.
spec_runner-devtests files inside
dev/src- they all run the same specs.
Install npm and run:
npm install --dev npm test
Each time you run
npm testthe files inside the
distfolder will be updated (it executes
node buildas a