memoize-fs
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -44,3 +44,3 @@ 'use strict'; | ||
if (typeof value === 'function') { | ||
return;// value; | ||
return; | ||
} | ||
@@ -128,3 +128,7 @@ if (typeof value === 'object' && value !== null) { | ||
// result has not been cached yet or needs to be recached - cache and return it! | ||
result = fn.apply(null, args); | ||
try { | ||
result = fn.apply(null, args); | ||
} catch (e) { | ||
return reject(e); | ||
} | ||
if (result && result.then) { | ||
@@ -131,0 +135,0 @@ // result is a promise instance |
{ | ||
"name": "memoize-fs", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "memoize/cache in file system solution for Node.js", | ||
@@ -11,3 +11,4 @@ "author": { | ||
"scripts": { | ||
"test": "mocha --reporter nyan test/testfiles" | ||
"test": "mocha --reporter nyan test", | ||
"cover": "rm -rf coverage && ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report html && open coverage/index.html" | ||
}, | ||
@@ -30,6 +31,9 @@ "homepage": "https://github.com/borisdiakur/memoize-fs", | ||
"lodash": "~2.4.1", | ||
"rimraf": "~2.2.8" | ||
"rimraf": "~2.2.8", | ||
"coveralls": "~2.10.0", | ||
"mocha-lcov-reporter": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.20.1" | ||
"mocha": "~1.20.1", | ||
"istanbul": "~0.2.11" | ||
}, | ||
@@ -36,0 +40,0 @@ "private": false, |
@@ -5,6 +5,7 @@ # memoize-fs | ||
[![NPM](https://nodei.co/npm/memoize-fs.png)](https://nodei.co/npm/memoize-fs/) | ||
[![Build Status](https://api.travis-ci.org/borisdiakur/memoize-fs.png?branch=master)](https://travis-ci.org/borisdiakur/memoize-fs) | ||
[![Coverage Status](https://img.shields.io/coveralls/borisdiakur/memoize-fs.svg)](https://coveralls.io/r/borisdiakur/memoize-fs) | ||
[![NPM](https://nodei.co/npm/memoize-fs.png?downloads=true)](https://nodei.co/npm/memoize-fs/) | ||
## Motivation | ||
@@ -43,3 +44,3 @@ This project is inspired by the [memoize project](https://github.com/medikoo/memoize) by [Mariusz Nowak aka medikoo](https://github.com/medikoo). | ||
__Note that a result of a momoised function is always a [Promise](http://www.html5rocks.com/en/tutorials/es6/promises/) instance!__ | ||
__Note that a result of a momoized function is always a [Promise](http://www.html5rocks.com/en/tutorials/es6/promises/) instance!__ | ||
@@ -95,3 +96,3 @@ ### Memoizing promisified functions | ||
```javascript | ||
memoize.fn(fun, { cacheId: foobar}).then(... | ||
memoize.fn(fun, { cacheId: 'foobar'}).then(... | ||
``` | ||
@@ -101,3 +102,3 @@ | ||
Functions may have references to variables outside their own scope. As a consequence two functions which look exactly the same (they have the same function signature and function body) can return different results even when executed with identical arguments. In order to avoid the same cache being used for two different functions you can use the salt option which mutates the hash key created for the memoized function which in turn defines the location of the cache file: | ||
Functions may have references to variables outside their own scope. As a consequence two functions which look exactly the same (they have the same function signature and function body) can return different results even when executed with identical arguments. In order to avoid the same cache being used for two different functions you can use the salt option which mutates the hash key created for the memoized function which in turn defines the name of the cache file: | ||
@@ -154,2 +155,4 @@ ```javascript | ||
v0.0.4 - refactoring, error handling, exclude tests in npmignore | ||
v0.0.3 - keywords in package.json, prettified readme, added npmignore | ||
@@ -156,0 +159,0 @@ |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
158
1
17647
6
2
174
1
+ Addedcoveralls@~2.10.0
+ Addedmocha-lcov-reporter@0.0.1
+ Addedargparse@0.1.16(transitive)
+ Addedasync@0.2.10(transitive)
+ Addedaws-sign@0.2.1(transitive)
+ Addedboom@0.3.8(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedcookie-jar@0.2.0(transitive)
+ Addedcoveralls@2.10.1(transitive)
+ Addedcryptiles@0.1.3(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedesprima@1.0.4(transitive)
+ Addedforever-agent@0.2.0(transitive)
+ Addedform-data@0.0.10(transitive)
+ Addedhawk@0.10.2(transitive)
+ Addedhoek@0.7.6(transitive)
+ Addedjs-yaml@3.0.1(transitive)
+ Addedjson-stringify-safe@3.0.0(transitive)
+ Addedlcov-parse@0.0.6(transitive)
+ Addedlog-driver@1.2.4(transitive)
+ Addedmime@1.2.11(transitive)
+ Addedmocha-lcov-reporter@0.0.1(transitive)
+ Addednode-uuid@1.4.8(transitive)
+ Addedoauth-sign@0.2.0(transitive)
+ Addedqs@0.5.6(transitive)
+ Addedrequest@2.16.2(transitive)
+ Addedsntp@0.1.4(transitive)
+ Addedtunnel-agent@0.2.0(transitive)
+ Addedunderscore@1.7.0(transitive)
+ Addedunderscore.string@2.4.0(transitive)