diff options
author | Kat Marchán <kzm@zkat.tech> | 2018-08-07 22:03:15 +0300 |
---|---|---|
committer | Kat Marchán <kzm@zkat.tech> | 2018-08-07 23:39:50 +0300 |
commit | e57d3457547ef464828fc6f82ae4750f3e511550 (patch) | |
tree | fd4bbba73c06991df3d16501aa027c2eef1bcd21 /node_modules | |
parent | 348fc91ad223ff91cd7bcf233018ea1d979a2af1 (diff) |
iferr@1.0.2
Credit: @shesek
Fixes: https://github.com/shesek/iferr/issues/2
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/iferr/README.md | 21 | ||||
-rw-r--r-- | node_modules/iferr/package.json | 35 |
2 files changed, 35 insertions, 21 deletions
diff --git a/node_modules/iferr/README.md b/node_modules/iferr/README.md index 0940763fa..7a24462a8 100644 --- a/node_modules/iferr/README.md +++ b/node_modules/iferr/README.md @@ -11,16 +11,29 @@ npm install iferr ## Use -### JavaScript example +### JavaScript/ES6 example +```js +var iferr = require('iferr'); + +function get_friends_count(id, cb) { + User.load_user(id, iferr(cb, user => + user.load_friends(iferr(cb, friends => + cb(null, friends.length) + )) + )) +} +``` + +### JavaScript/ES5 example ```js var iferr = require('iferr'); function get_friends_count(id, cb) { User.load_user(id, iferr(cb, function(user) { user.load_friends(iferr(cb, function(friends) { - cb(null, friends.length); - })); - })); + cb(null, friends.length) + })) + })) } ``` diff --git a/node_modules/iferr/package.json b/node_modules/iferr/package.json index 69833649d..eead655e6 100644 --- a/node_modules/iferr/package.json +++ b/node_modules/iferr/package.json @@ -1,46 +1,47 @@ { - "_args": [ - [ - "iferr@1.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "iferr@1.0.0", - "_id": "iferr@1.0.0", + "_from": "iferr@1.0.2", + "_id": "iferr@1.0.2", "_inBundle": false, - "_integrity": "sha512-0+ecqiP/cxgnNBIPi+TgJlaxE7sFp2N3kBFg17klQUdf24YKiaEV6b9QgEqOlD5vCVCE0U7OV9lPSN2OfS4zoQ==", + "_integrity": "sha512-9AfeLfji44r5TKInjhz3W9DyZI1zR1JAf2hVBMGhddAKPqBsupb89jGfbCTHIGZd6fGZl9WlHdn4AObygyMKwg==", "_location": "/iferr", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "iferr@1.0.0", + "raw": "iferr@1.0.2", "name": "iferr", "escapedName": "iferr", - "rawSpec": "1.0.0", + "rawSpec": "1.0.2", "saveSpec": null, - "fetchSpec": "1.0.0" + "fetchSpec": "1.0.2" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/iferr/-/iferr-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/iferr/-/iferr-1.0.2.tgz", + "_shasum": "e9fde49a9da06dc4a4194c6c9ed6d08305037a6d", + "_spec": "iferr@1.0.2", + "_where": "/Users/zkat/Documents/code/work/npm", "author": { "name": "Nadav Ivgi" }, "bugs": { "url": "https://github.com/shesek/iferr/issues" }, + "bundleDependencies": false, + "deprecated": false, "description": "Higher-order functions for easier error handling", "devDependencies": { - "coffee-script": "^1.12.7", + "coffeescript": "^2.3.1", "mocha": "^4.0.1" }, "engines": { "node": ">=6.0.0" }, + "files": [ + "iferr.js" + ], "homepage": "https://github.com/shesek/iferr", "keywords": [ "error", @@ -56,5 +57,5 @@ "scripts": { "test": "mocha" }, - "version": "1.0.0" + "version": "1.0.2" } |