
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Simple, server-side routing to complement the node.js path module.
Install with npm:
npm i rte --save-dev
Run mocha or npm test to run the tests. Visit the tests to learn how this works.
Create a new instance:
// optionally pass a default `context`
var rte = new Route({root: '_gh_pages', ext: '.html'});
Next, define some routes to use:
rte.set('site', ':root/:basename/index:ext');
rte.set('blog', ':root/blog/:basename/index:ext');
Last, generate your destination paths:
// use the `site` route to create the dest filepath
var dest = rte.dest('src/templates/about.hbs', 'site');
// => '_gh_pages/about/index.html'
// use the `blog` route to create the dest filepath
var dest = rte.dest('src/templates/about.hbs', 'site');
// => '_gh_pages/blog/about/index.html'
Override the default context:
var dest = rte.dest('src/templates/about.hbs', 'site', {root: 'dist'});
// => 'dist/blog/about/index.html'
Define a new instance of Route, optionally passing a default context object.
Example
var route = new Route({base: 'dist'});
type {String}:returnSet or get a route by name.
route.set('dest', ':base/:dirname/:basename/index.html');
name {String}:route {String}:returnGet a route by name.
route.get('dest');
// ':base/:dirname/:basename/index.html'
name {String}:returnRename parts of a file path using rename-path.
route.rename ('a/b/c.hbs', {ext: '.html'});
//=> 'a/b/c.html'
filepath {String}:options {Object}:returnParse the filepath into an object using the named route and the methods on the node.js path module. The purpose of this method is to simplify the process of renaming parts of file paths.
Example:
Given this route:
rte.set('foo', ':a/:b/:basename/index:ext');
We can parse a filepath and create an object that consists of properties that are created using the foo route, e.g.
var obj = rte.parse('src/templates/about.hbs', 'foo', {
a: 'one',
b: 'two',
ext: '.html'
});
console.log(obj);
which results in:
{
dirname: 'src/templates',
basename: 'about',
name: 'about',
extname: '.hbs',
extSegments: ['.hbs'],
ext: '.html',
a: 'one',
b: 'two',
dest: 'one/two/about/index.html' // based on the `foo` propstring
}
filepath {String}:name {String}: The name of the route to usecontext {Object}: Optionally pass a context with custom properties.returnFacade for .parse(), returning only the dest value.
Example:
rte.set('blog', ':foo/:basename/index:ext');
// use the `blog` route to create a dest filepath
var dest = rte.dest('src/templates/about.hbs', 'blog');
// => '_gh_pages/about/index.html'
filepath {String}:name {String}: The name of the route to usecontext {Object}: Optionally pass a context with custom properties.returnResolve a named route using the properties on the given object.
route.process (name, context)
Example:
route.process(':a/:b/:c', {a: 'one', b: 'two', c: 'three'});
//=> 'one/two/three'
key {String}:context {Object}:returnResolve a named route using the properties on the given object.
route.resolve (name, context)
Example:
route.set('dist', ':foo/:basename/index.html');
route.resolve('dist', {foo: '_gh_pages', basename: 'foo'});
//=> '_gh_pages/foo/index.html'
key {String}:context {Object}:returnExpose Route
returnFind a bug? Have a feature request? Please create an Issue.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality,
and run docs in the command line to build the docs with Verb.
Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on July 10, 2014.
FAQs
Simple filepath re-writing for node.js projects. Useful for re-writing paths in grunt/gulp/assemble tasks or plugins.
The npm package rte receives a total of 8 weekly downloads. As such, rte popularity was classified as not popular.
We found that rte 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.