crossroads.js

JavaScript Routes

  • Owner: millermedeiros/crossroads.js
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Build Status


Crossroads - JavaScript Routes

Introduction

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.

Dependencies

This library requires JS-Signals to work.

License

MIT License

Distribution Files

Files inside dist folder.

  • crossroads.js : Uncompressed source code with comments.
  • crossroads.min.js : Compressed code.

You can install Crossroads on Node.js using NPM

npm install crossroads

Repository Structure

Folder Structure

dev       ->  development files, - lib          ->  3rd-party libraries, - src          ->  source files, - tests        ->  unit tests
dist      ->  distribution files

Branches

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:

node build

This will delete all JS files inside the dist folder, merge/update/compress source files and copy the output to the dist folder.

IMPORTANT: dist folder always contain the latest version, regular users should not need to run build task.

Running unit tests

On the browser

Open dev/tests/spec_runner-dist.html on your browser.

spec_runner-dist tests dist/crossroads.js and spec_runner-dev tests files inside
dev/src - they all run the same specs.

On Node.js

Install npm and run:

npm install --dev
npm test

Each time you run npm test the files inside the dist folder will be updated
(it executes node build as a pretest script).

Main metrics

Overview
Name With Ownermillermedeiros/crossroads.js
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 3)
Platform
License:
所有者活动
Created At2011-04-14 00:32:07
Pushed At2023-09-13 12:48:28
Last Commit At2015-07-31 15:37:44
Release Count18
Last Release Namev0.12.2 (Posted on )
First Release Namev0.1 (Posted on )
用户参与
Stargazers Count1.4k
Watchers Count39
Fork Count154
Commits Count188
Has Issues Enabled
Issues Count140
Issue Open Count40
Pull Requests Count9
Pull Requests Open Count24
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private