🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

async-deco

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-deco - npm Package Compare versions

Comparing version

to
3.4.1

4

package.json
{
"name": "async-deco",
"version": "3.4.0",
"version": "3.4.1",
"description": "A collection of decorators for adding features to asynchronous functions (callback or promise based).",

@@ -28,3 +28,3 @@ "main": "index.js",

"husky": "^0.10.2",
"memoize-cache": "0.1.0",
"memoize-cache": "^1.0.0",
"mocha": "^2.1.0",

@@ -31,0 +31,0 @@ "npm-release": "^1.0.0"

@@ -93,4 +93,3 @@ async-deco

-----
It is a more sophisticated version of the memoize decorator. It can be used for caching in a db/file etc (You may have to write your own cache object).
memoize-cache is an in-memory reference implementation (https://github.com/sithmel/memoize-cache).
It is a more sophisticated version of the memoize decorator. It can be used for caching in a db/file etc using memoize-cache (https://github.com/sithmel/memoize-cache).
```js

@@ -108,3 +107,3 @@ var cacheDecorator = require('async-deco/callback/cache');

-----
It executes a "guard" function before the original one. If it returns an error it will use this error as the return value of the original function.
It executes a "guard" function before the original one. If it returns an error it will use this error as the return value of the original function.
It is useful if you want to run a function only if it passes some condition (access control).

@@ -111,0 +110,0 @@ ```js

@@ -34,3 +34,3 @@ var assert = require('chai').assert;

assert.deepEqual(log, [
{type: 'cachehit', obj: {key: '6', result: 6}},
{type: 'cachehit', obj: {key: '1679091c5a880faf6fb5e6087eb1b2dc', result: 6}},
]);

@@ -37,0 +37,0 @@ done();

@@ -37,3 +37,3 @@ var assert = require('chai').assert;

assert.deepEqual(log, [
{type: 'cachehit', obj: {key: '6', result: 6}},
{type: 'cachehit', obj: {key: '1679091c5a880faf6fb5e6087eb1b2dc', result: 6}},
]);

@@ -40,0 +40,0 @@ done();