instapromise
Advanced tools
Comparing version 0.8.0 to 1.0.0
@@ -6,3 +6,3 @@ // Generated by CoffeeScript 1.9.0 | ||
__doc__ = "If you use this library then if you put `.promise` after a Node-style async\nfunction, it will turn it into a function that returns a Promise instead of\ntaking a callback.\n\n```\n promisify = require 'instapromise'\n p = fs.readFile.promise \"/tmp/hello\", 'utf8'\n p.then(console.log)\n```\n\nIf you want to promisify methods, use `.promise` after the object and before\nthe method name.\n\n```\n promisify = require 'instapromise'\n p = fs.promise.readFile \"/tmp/hello\", 'utf8'\n p.then(console.log)\n```\n\nThis code is based on the proxying code used in fibrous.\nhttps://github.com/goodeggs/fibrous/blob/master/src/fibrous.coffee\n"; | ||
__doc__ = "If you use this library then if you put `.promise` after a Node-style async\nfunction, it will turn it into a function that returns a Promise instead of\ntaking a callback.\n\nThe original function is available as a property on the Promise generating\nfunction (`.___instapromiseOriginalFunction___`).\n\n```\n promisify = require 'instapromise'\n p = fs.readFile.promise \"/tmp/hello\", 'utf8'\n p.then(console.log)\n```\n\nIf you want to promisify methods, use `.promise` after the object and before\nthe method name.\n\n```\n promisify = require 'instapromise'\n p = fs.promise.readFile \"/tmp/hello\", 'utf8'\n p.then(console.log)\n```\n\nThis code is based on the proxying code used in fibrous.\nhttps://github.com/goodeggs/fibrous/blob/master/src/fibrous.coffee\n"; | ||
@@ -56,3 +56,4 @@ Promise = require('native-or-bluebird'); | ||
} | ||
return target[key] = proxyFn(key); | ||
target[key] = proxyFn(key); | ||
return target[key].___instapromiseOriginalFunction___ = src[key]; | ||
}; | ||
@@ -78,3 +79,3 @@ for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
} | ||
})(), Object.getPrototypeOf(that) !== Function.prototype ? func.__proto__ = Object.getPrototypeOf(that)[prop] : void 0, func) : Object.create(Object.getPrototypeOf(that) && Object.getPrototypeOf(that)[prop] || Object.prototype); | ||
})(), Object.getPrototypeOf(that) !== Function.prototype ? func.__proto__ = Object.getPrototypeOf(that)[prop] : void 0, func.___instapromiseOriginalFunction___ = that, func) : Object.create(Object.getPrototypeOf(that) && Object.getPrototypeOf(that)[prop] || Object.prototype); | ||
result.that = that; | ||
@@ -81,0 +82,0 @@ return proxyAll(that, result, function(key) { |
{ | ||
"name": "instapromise", | ||
"version": "0.8.0", | ||
"version": "1.0.0", | ||
"description": "Promisify node style async functions by putting a .promise after them (or after the object for methods)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,2 +8,5 @@ # instapromise | ||
The original function is available as a property on the Promise generating | ||
function (`.___instapromiseOriginalFunction___`). | ||
``` | ||
@@ -10,0 +13,0 @@ promisify = require 'instapromise' |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19034
200
1
29