Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conduttore

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conduttore

A multi-purpose Router

  • 0.1.3
  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Conduttore Build Status

Features

  • Fast, very fast!!
  • Multipurpose
    • Environment agnostic - isomorphic implementation
    • Purpose agnostic (i.e. not just for URLs routing)
  • Automatic route parameters retrieval and type coercion

Installation

Using NPM with: npm install conduttore

Using bower.js: bower install conduttore

Example

var conduttore = require('conduttore')

function handler (controller, action, type)

var router = conduttore({
	aliases: {
		':controller': ':text',
		':action': ':text'
	},

	params: {
		':type': ['topolino', 'pluto']
	},

	routes: [
		{ '/:controller/:action/:type': handler},
		{ '*': defaultHandler }
	]
})

// retrieve the route value (a function in this case)
router.resolve('/users/edit/topolino')

// or invoke the route handler
router
	.dispatch('/users/edit/topolino')
	.then(function (handlerResult) {
		// your post processing logic goes here
	})

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

License

Copyright (c) 2014 Cesare Naldi
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 16 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc