Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "asyncy", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A utility for creating aysnc functions", | ||
@@ -5,0 +5,0 @@ "engines": {}, |
@@ -10,2 +10,4 @@ # asyncy | ||
The current releases of Chrome, Firefox, Edge, and Node.js support the raw, un-transpiled code. | ||
## Inline Usage | ||
@@ -17,5 +19,7 @@ | ||
``` | ||
const {err,result,args} = await asyncy.inline(fs.readFile,"mystuff.json"); | ||
const {err,result,args} = await asyncy.inline(fs,fs.readFile,"mystuff.json"); | ||
``` | ||
The first argument can either be `null` or the scope in which the function should be invoked, i.e. the `this` context. | ||
`err` will be `null` or an `Error` instance | ||
@@ -31,3 +35,3 @@ | ||
``` | ||
const {err,result,args} = await asyncy.inline(fs.readFile,"mystuff.json"); | ||
const {err,result,args} = await asyncy.inline(fs,fs.readFile,"mystuff.json"); | ||
if(err) throw err; | ||
@@ -40,3 +44,3 @@ ``` | ||
``` | ||
const {err,result,args} = await asyncy.inline(fs.readFile,"mystuff.json",(err,arg1[,arg2...]) => { console.log(arg1,"allocated"); }); | ||
const {err,result,args} = await asyncy.inline(fs,fs.readFile,"mystuff.json",(err,arg1[,arg2...]) => { console.log(arg1,"allocated"); }); | ||
``` | ||
@@ -51,3 +55,3 @@ | ||
``` | ||
const {err,result,args} = await asyncy.inline(fs.readFile,"mystuff.json"); | ||
const {err,result,args} = await asyncy.inline(fs,fs.readFile,"mystuff.json"); | ||
if(err) ... handle error ... | ||
@@ -68,5 +72,7 @@ console.log(result[0],"allocated"); | ||
or you can `async` an entire object (`asyncy` will skip functions with names that end in the token "Sync", where "S" is capitalized.): | ||
There is no contect provided at re-define time; however, it can be provided at invocation time, e.g. `readFile.call(scope,fileName)`. | ||
You can also `async` an entire object (`asyncy` will skip functions with names that end in the token "Sync", where "S" is capitalized.): | ||
``` | ||
@@ -90,4 +96,7 @@ fs = asyncy(fs,true), | ||
2017-06-03 v0.0.3 improved documentation | ||
2017-06-03 v0.0.2 Simplified code, added documentation | ||
2017-06-02 Initial public release |
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
9918
96