Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 434 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 434 Bytes

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