From 56e97a405878055f2d65ee6f97b040f434819ac7 Mon Sep 17 00:00:00 2001 From: tunnckoCore Date: Sun, 19 Mar 2017 07:10:12 +0200 Subject: [PATCH] fix(docs): update docs --- .verb.md | 4 ++++ README.md | 17 +++++++++-------- dist/redolent.common.js | 10 +++------- dist/redolent.es.js | 10 +++------- index.js | 10 +++------- 5 files changed, 22 insertions(+), 29 deletions(-) diff --git a/.verb.md b/.verb.md index 77c41e7..316c28d 100644 --- a/.verb.md +++ b/.verb.md @@ -38,6 +38,10 @@ const {%= varname %} = require('{%= name %}') ## API {%= apidocs('index.js') %} +**Tip:** You can use `require('native-or-another/register')` instead of passing +a promise to `opts.Promise`, it exposes a function that accepts same +options object, `{ Promise: MyPromise }` for example. + ### Detecting Promise > For testing and such purposes you may want to detect which promise is used. Because of that the returned promise has `promise.___nativePromise` which will be `true` if native Promise diff --git a/README.md b/README.md index 9be581d..10cb921 100644 --- a/README.md +++ b/README.md @@ -49,15 +49,12 @@ const redolent = require('redolent') ## API -### [redolent](index.js#L86) -Will try to promisify `fn` with native Promise, otherwise you can give different promise module to `opts.Promise`, for example [pinkie][] or [bluebird][]. If `fn` [is-async-function][] it will be passed with `done` callback as last argument - always concatenated with the other provided args through `opts.args`. +### [redolent](index.js#L82) +> Will try to promisify `fn` with native Promise, otherwise you can give different promise module to `opts.Promise`, for example [pinkie][] or [bluebird][]. If `fn` [is-async-function][] it will be passed with `done` callback as last argument - always concatenated with the other provided args through `opts.args`. -_**Note:** Uses [native-or-another][] for detection, so it will always will use the +**Note:** Uses [native-or-another][] for detection, so it will always will use the native Promise, otherwise will try to load some of the common promise libraries -and as last resort if can't find one of them installed, then throws an Error!_ -**Tip:** You can use `require('native-or-another/register')` instead of passing -a promise to `opts.Promise`, it exposes a function that accepts same -options object, `{ Promise: MyPromise }` for example. +and as last resort if can't find one of them installed, then throws an Error! **Params** @@ -99,6 +96,10 @@ fn(3, 5).then((res) => { }) ``` +**Tip:** You can use `require('native-or-another/register')` instead of passing +a promise to `opts.Promise`, it exposes a function that accepts same +options object, `{ Promise: MyPromise }` for example. + ### Detecting Promise > For testing and such purposes you may want to detect which promise is used. Because of that the returned promise has `promise.___nativePromise` which will be `true` if native Promise @@ -176,7 +177,7 @@ Copyright © 2015, 2017, [Charlike Mike Reagent](https://i.am.charlike.online). *** -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 17, 2017._ +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 19, 2017._ _Project scaffolded using [charlike][] cli._ [always-done]: https://github.com/hybridables/always-done diff --git a/dist/redolent.common.js b/dist/redolent.common.js index 201cee4..b95fb99 100644 --- a/dist/redolent.common.js +++ b/dist/redolent.common.js @@ -1656,20 +1656,16 @@ var index$16 = function isAsyncFunction (fn, names, strict) { }; /** - * Will try to promisify `fn` with native Promise, + * > Will try to promisify `fn` with native Promise, * otherwise you can give different promise module * to `opts.Promise`, for example [pinkie][] or [bluebird][]. * If `fn` [is-async-function][] it will be passed with `done` callback * as last argument - always concatenated with the other provided args * through `opts.args`. * - * _**Note:** Uses [native-or-another][] for detection, so it will always will use the + * **Note:** Uses [native-or-another][] for detection, so it will always will use the * native Promise, otherwise will try to load some of the common promise libraries - * and as last resort if can't find one of them installed, then throws an Error!_ - * - * **Tip:** You can use `require('native-or-another/register')` instead of passing - * a promise to `opts.Promise`, it exposes a function that accepts same - * options object, `{ Promise: MyPromise }` for example. + * and as last resort if can't find one of them installed, then throws an Error! * * **Example** * diff --git a/dist/redolent.es.js b/dist/redolent.es.js index 1f799c3..e4f7322 100644 --- a/dist/redolent.es.js +++ b/dist/redolent.es.js @@ -1654,20 +1654,16 @@ var index$16 = function isAsyncFunction (fn, names, strict) { }; /** - * Will try to promisify `fn` with native Promise, + * > Will try to promisify `fn` with native Promise, * otherwise you can give different promise module * to `opts.Promise`, for example [pinkie][] or [bluebird][]. * If `fn` [is-async-function][] it will be passed with `done` callback * as last argument - always concatenated with the other provided args * through `opts.args`. * - * _**Note:** Uses [native-or-another][] for detection, so it will always will use the + * **Note:** Uses [native-or-another][] for detection, so it will always will use the * native Promise, otherwise will try to load some of the common promise libraries - * and as last resort if can't find one of them installed, then throws an Error!_ - * - * **Tip:** You can use `require('native-or-another/register')` instead of passing - * a promise to `opts.Promise`, it exposes a function that accepts same - * options object, `{ Promise: MyPromise }` for example. + * and as last resort if can't find one of them installed, then throws an Error! * * **Example** * diff --git a/index.js b/index.js index 11816c1..db5f5dd 100644 --- a/index.js +++ b/index.js @@ -15,20 +15,16 @@ var Promize = require('native-or-another') var isAsync = require('is-async-function') /** - * Will try to promisify `fn` with native Promise, + * > Will try to promisify `fn` with native Promise, * otherwise you can give different promise module * to `opts.Promise`, for example [pinkie][] or [bluebird][]. * If `fn` [is-async-function][] it will be passed with `done` callback * as last argument - always concatenated with the other provided args * through `opts.args`. * - * _**Note:** Uses [native-or-another][] for detection, so it will always will use the + * **Note:** Uses [native-or-another][] for detection, so it will always will use the * native Promise, otherwise will try to load some of the common promise libraries - * and as last resort if can't find one of them installed, then throws an Error!_ - * - * **Tip:** You can use `require('native-or-another/register')` instead of passing - * a promise to `opts.Promise`, it exposes a function that accepts same - * options object, `{ Promise: MyPromise }` for example. + * and as last resort if can't find one of them installed, then throws an Error! * * **Example** *