file-reader
Advanced tools
Comparing version 0.1.0 to 0.1.1
24
index.js
@@ -17,13 +17,15 @@ /*! | ||
module.exports = function (patterns, options) { | ||
return mapFiles(patterns, merge({}, options, { | ||
name: function camelize(fp) { | ||
var str = path.basename(fp, path.extname(fp)); | ||
return str.replace(/-(.)/, function (_, s) { | ||
return s.toUpperCase(); | ||
}); | ||
}, | ||
read: function read(fp) { | ||
return reader(path.extname(fp))(path.resolve(fp)); | ||
} | ||
})); | ||
options = merge({name: camelize, read: read}, options); | ||
return mapFiles(patterns, options); | ||
}; | ||
function camelize(fp) { | ||
var str = path.basename(fp, path.extname(fp)); | ||
return str.replace(/-(.)/, function (_, s) { | ||
return s.toUpperCase(); | ||
}); | ||
} | ||
function read(fp) { | ||
return reader(path.extname(fp))(path.resolve(fp)); | ||
} |
{ | ||
"name": "file-reader", | ||
"description": "Read a glob of files, dynamically choosing the reader or requiring the files based on the file extension.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/file-reader", | ||
@@ -35,3 +35,19 @@ "author": { | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"detect", | ||
"file", | ||
"format", | ||
"fs", | ||
"js", | ||
"json", | ||
"map", | ||
"read", | ||
"read-file", | ||
"read-file-sync", | ||
"reader", | ||
"text", | ||
"util", | ||
"utils", | ||
"yaml" | ||
], | ||
"dependencies": { | ||
@@ -42,2 +58,2 @@ "fs-utils": "^0.5.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
7664
86