Coder Social home page Coder Social logo

crossroads.js's Introduction

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.

Links

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

Note that node.js can only run the distribution file, so any change to the dev/src files will require a new node build. npm link takes care of installing dependencies and updating crossroads at each change to the dist/crossroads.js file.

crossroads.js's People

Contributors

millermedeiros avatar jfhbrook avatar

Watchers

Bror avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.