Skip to content

justinffs/globject

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

globject

Get values by glob-like keys

Install

npm install globject --save

Usage

var globject = require('globject');
var routes = {
  '**/about/**': 'about.html',
  '**': 'index.html'
};

var routesObj = globject(routes);

console.log(routesObj('/about/somepage.html')); // OUTPUTS: about.html
console.log(routesObj('/any/route.html'')); // OUTPUTS: index.html

Run Tests

npm install
npm test

About

Get values by glob-like keys

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%