glob-cache
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -6,4 +6,17 @@ # Change Log | ||
## [0.1.1](https://github.com/tunnckoCore/opensource/compare/glob-cache@0.1.0...glob-cache@0.1.1) (2020-01-19) | ||
### Bug Fixes | ||
* update param type annotations, regen readmes ([783c4b9](https://github.com/tunnckoCore/opensource/commit/783c4b9ed402621ecdfbda524c0a53b30f83ae68)) | ||
* **docks:** supports param's type, run docs -> update readmes ([21da65c](https://github.com/tunnckoCore/opensource/commit/21da65ce3d0a73779a382262a8151da433f12ce3)) | ||
* **glob-cache:** add docs, generate readme ([9acd530](https://github.com/tunnckoCore/opensource/commit/9acd530b1723bf2f4ef436eb9079d02c9cabde9c)) | ||
# 0.1.0 (2020-01-18) | ||
**Note:** Version bump only for package glob-cache |
{ | ||
"name": "glob-cache", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Caching layer (using `cacache`) for any file globbing solution (`glob`, `fast-glob`, `tiny-glob`). Makes you Instant Fast™ and allows you to hook into very specific & important part of the process", | ||
@@ -26,16 +26,16 @@ "repository": { | ||
"keywords": [ | ||
"tunnckocorehq", | ||
"tunnckocore-oss", | ||
"hela", | ||
"cacache", | ||
"cache", | ||
"cache-layer", | ||
"caching", | ||
"developer-experience", | ||
"development", | ||
"developer-experience", | ||
"dx", | ||
"cache", | ||
"cacache", | ||
"caching", | ||
"cache-layer", | ||
"fast-glob", | ||
"glob", | ||
"globbing", | ||
"hela", | ||
"tiny-glob", | ||
"glob", | ||
"globbing" | ||
"tunnckocore-oss", | ||
"tunnckocorehq" | ||
], | ||
@@ -58,3 +58,4 @@ "scripts": {}, | ||
"cov": { | ||
"color": "grey" | ||
"value": 6.93, | ||
"color": "red" | ||
}, | ||
@@ -77,3 +78,8 @@ "licenseStart": 2020, | ||
}, | ||
"reflinks": [], | ||
"reflinks": [ | ||
"cacache", | ||
"fast-glob", | ||
"glob", | ||
"tiny-glob" | ||
], | ||
"related": { | ||
@@ -83,3 +89,3 @@ "list": [] | ||
}, | ||
"gitHead": "2469007daee317ab9a5b133622280617c3976fa0" | ||
"gitHead": "2c533adbdb9674b5f2a88e8ef08ef2beda80385a" | ||
} |
@@ -17,7 +17,35 @@ /* eslint-disable no-param-reassign */ | ||
glob: fastGlob, | ||
globOptions: {}, | ||
cacheLocation: './.cache/glob-cache', | ||
fastGlobOptions: {}, | ||
}; | ||
module.exports = async function globCache(options = {}) { | ||
/** | ||
* Match files and folders using glob patterns. Returns a resolved Promise containing | ||
* a `{ results, cacache }` object - where `results` is an array of [Context](#context) objects | ||
* and `cacache` is the [cacache][] package. | ||
* | ||
* @example | ||
* const tinyGlob = require('tiny-glob'); | ||
* const glob = require('glob-cache'); | ||
* | ||
* glob({ | ||
* include: 'src/*.js', | ||
* glob: tinyGlob, | ||
* }).then(({ results, cacache }) => { | ||
* console.log(results); | ||
* }); | ||
* | ||
* | ||
* @name globCache | ||
* @param {string|Array<string>} options.include - string or array of string glob patterns | ||
* @param {string} options.exclude - ignore patterns | ||
* @param {Function} options.hook - a hook function passed with [Context](#context) | ||
* @param {boolean} options.always - a boolean that makes `options.hook` to always be called | ||
* @param {Function} options.glob - a globbing library like [glob][], [fast-glob][], [tiny-glob][], defaults to `fast-glob` | ||
* @param {object} options.globOptions - options passed to the `options.glob` library | ||
* @param {string} options.cacheLocation - a filepath location of the cache, defaults to `./.cache/glob-cache` | ||
* @returns {Promise} | ||
* @public | ||
*/ | ||
module.exports = async function globCache(options) { | ||
const opts = { ...defaultOptions, ...options }; | ||
@@ -24,0 +52,0 @@ if (typeof opts.glob !== 'function') { |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
21532
4
168
1
261