Comparing version 2.0.0 to 2.1.0
@@ -27,5 +27,6 @@ var path = require('path'); | ||
var ctrlDir = path.join(path.dirname(module.parent.filename), options.controllers || 'controllers'); | ||
var keyRE = new RegExp('(' + methods.join('|') + ')(?:\\s+((?:\\/(.+)\\/)|([^\\/].*[^\\/])))?', 'i') | ||
var keyRE = new RegExp('(' + methods.join('|') + ')(?:\\s+((?:\\/(.+)\\/)|([^\\/].*[^\\/])))?', 'i'); | ||
var globOptions = options.glob || {}; | ||
glob.sync(ctrlDir + "/**/*.js").forEach(function (file) { | ||
glob.sync(ctrlDir + "/**/*.js", globOptions).forEach(function (file) { | ||
file = file.replace(/\.[^.]*$/, ''); | ||
@@ -32,0 +33,0 @@ |
{ | ||
"name": "rainbow", | ||
"description": "Express router middleware for RESTful API base on certain folder path", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "mytharcher <mytharcher@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -193,2 +193,5 @@ Rainbow | ||
Options | ||
---------- | ||
### Change default path ### | ||
@@ -206,5 +209,23 @@ | ||
### Glob ### | ||
From v2.1.0 you could use `glob` in options to config any option supported by npm [glob](https://www.npmjs.com/package/glob), such as excluding files. | ||
~~~javascript | ||
app.use(rainbow({ | ||
glob: { | ||
ignore: [ | ||
'**.spec.js' // any spec file for test cases will be ignored from controller folder | ||
] | ||
} | ||
})); | ||
~~~ | ||
Change log | ||
---------- | ||
### 2.1.0 ### | ||
* Add `glob` option for more glob configurations. | ||
### 2.0.0 ### | ||
@@ -211,0 +232,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9382
56
255