
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
config-router
Advanced tools
Config Router is a wrapper over Router5 following philosophy of Config driven approach. Config Router exposes only the methods/properties required in building a typical single page application.
Config Router distributables are available inside "dist" directory. And it can be included in any html using script tag as:
<script src="//raw.githubusercontent.com/sarunathan/config-router/master/dist/router.min.js"></script>
This way it will make configRouter available globally.
Blinx Router is available over npm also. It can be installed using npm as
npm install config-router --save
Which can be accessed as
import configRouter from "config-router";
To start using Config Router, these basic steps are required:
// Require Config Router
import configRouter from "config-router";
// Initialize Router
configRouter.init(instance); // Where instance should implement "createInstance" and "destroInstance" method.
// Configure Router
configRouter.configure(routeMap, routerOptions);
// Start Router
configRouter.start();
To intiliaze router, frameWorkInstance needs to be passed.
configRouter.init(frameWorkInstance);
Where frameWorkInstance should implement "createInstance" and "destroInstance" method for creating and destroying UI components respectively.
Accepts two parameters
[
{ name: 'users', path: '/users', moduleConfig: {}},
{ name: 'users.view', path: '/list', moduleConfig: {}},
{ name: 'users.list', path: '/view', moduleConfig: {}}
];
{
useHash: true,
hashPrefix: '!',
defaultRoute: 'home',
defaultParams: {},
base: '',
trailingSlash: false,
autoCleanUp: true,
strictQueryParams: true,
logger: false,
history: false,
listener: false
}
Use of hash part of URL - Set useHash to true if you want the paths of your routes to be prefixed with a hash. You can also choose a hashPrefix which will be inserted between the path of a route and the hash. Those options will mostly be used by plugins such as router5-history.
Default route - When your router instance starts, it will navigate to a default route if such route is defined and if it cannot match the URL against a known route:
Default params - the default route params (defaults to {})
Base path - You can specify what the base path of your application is. By default base is set to an empty string, meaning your route paths won't be prefixed by any path.
Optional trailing slashes - By default, the router is in "strict match" mode. If you want trailing slashes to be optional, you can set trailingSlash to a truthy value.
Automatic clean up - If autoCleanUp is set to true, the router will automatically clear canDeactivate functions / booleans when their associated segment becomes inactive.
Strict query parameters - Query parameters are optional, meaning a route can still be matched if a query parameter defined in its path is not present. However, if extra query parameters are present in the path which is being matched, matching will fail. If you want the router to still match routes if extra query parameters are present, set strictQueryParams to false.
logger - Enable router logger using logger plugin.
history - Enable history using history plugin.
listener - Enable listener using listener plugin.
This function can be used to add more routes once router has been initialized. This accepts the falt route array in param and it should not duplicate any route which has been already registered.
To start the router. This method does not require any parameter.
To stop router once router has been started.
Returns the route parameters. Both url and query params.
Returns name and path along with current route params.
FAQs
Router for UI Applications.
The npm package config-router receives a total of 0 weekly downloads. As such, config-router popularity was classified as not popular.
We found that config-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.