Comparing version 0.1.6 to 0.1.7
@@ -56,2 +56,9 @@ var sharp = require("./build/Release/sharp"); | ||
module.exports.cache = function(limit) { | ||
if (Number.isNaN(limit)) { | ||
limit = null; | ||
} | ||
return sharp.cache(limit); | ||
} | ||
/* Deprecated v0.0.x methods */ | ||
@@ -58,0 +65,0 @@ module.exports.crop = function(input, output, width, height, sharpen, callback) { |
{ | ||
"name": "sharp", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"author": "Lovell Fuller", | ||
@@ -5,0 +5,0 @@ "description": "High performance module to resize JPEG, PNG, WebP and TIFF images using the libvips image processing library", |
@@ -54,3 +54,3 @@ # sharp | ||
### Examples | ||
#### Examples | ||
@@ -105,2 +105,16 @@ ```javascript | ||
### cache([limit]) | ||
If `limit` is provided, set the `vips` internal cache limit to this value in MB. The default value is 100. | ||
Always returns cache statistics, namely current usage, high water mark and maximum limit. | ||
The high water mark may be higher than the maximum limit. | ||
```javascript | ||
var stats = sharp.cache(); // { current: 98, high: 115, limit: 100 } | ||
sharp.cache(200); // { current: 98, high: 115, limit: 200 } | ||
sharp.cache(50); // { current: 49, high: 115, limit: 50 } | ||
``` | ||
## Testing | ||
@@ -107,0 +121,0 @@ |
@@ -29,2 +29,4 @@ var sharp = require("../index"); | ||
); | ||
}, function() {}); | ||
}, function() { | ||
console.dir(sharp.cache()); | ||
}); |
@@ -423,2 +423,3 @@ var sharp = require("../index"); | ||
}); | ||
console.dir(sharp.cache()); | ||
}); |
Sorry, the diff of this file is not supported yet
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
1269018
514
198