Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Jun 21, 2016
1 parent 52f7437 commit 820725f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .verb.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ npm i {%= name %} --save
```

## Usage
> For more use-cases see the [tests](./test.js), [examples](./examples) or the passing [`co@4` tests](./test/co)
> For more use-cases see the [tests](./test.js), [examples](./examples) or all the passing [`co@4` tests](./test/co)
```js
const fs = require('fs')
Expand All @@ -106,7 +106,7 @@ promise.then(value => {
})
```

If you want to convert generator function to regular function that returns a Promise use `{%= varname %}.promisify`
If you want to convert generator function to regular function that returns a Promise use [{%= varname %}.promisify](#promisify)

**Example**

Expand All @@ -123,7 +123,7 @@ fn(456).then(number => {
})
```

If you want to promisify **any** type of function, again, just use the `.promisify` method, like you do with [bluebird][].promisify.
If you want to promisify **any** type of function, again, just use the [.promisify](#promisify) method, like you do with [bluebird][].promisify.

```js
const fs = require('fs')
Expand Down
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ You might also be interested in [relike][], [relike-all][], [relike-value][] and
- [Install](#install)
- [Usage](#usage)
- [API](#api)
* [letta](#letta)
* [.promisify](#promisify)
* [.Promise](#promise)
- [Examples](#examples)
* [Callback functions](#callback-functions)
Expand All @@ -27,6 +25,7 @@ You might also be interested in [relike][], [relike-all][], [relike-value][] and
* [Passing function as last argument](#passing-function-as-last-argument)
- [Related](#related)
- [Contributing](#contributing)
- [[Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]](#charlike-make-reagenthttpjmp1stw47c-new-message-to-charlikenew-message-imgnew-message-url-freenode-#charlikefreenode-imgfreenode-url)

_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_

Expand Down Expand Up @@ -108,7 +107,7 @@ npm i letta --save
```

## Usage
> For more use-cases see the [tests](./test.js), [examples](./examples) or the passing [`co@4` tests](./test/co)
> For more use-cases see the [tests](./test.js), [examples](./examples) or all the passing [`co@4` tests](./test/co)
```js
const fs = require('fs')
Expand All @@ -126,7 +125,7 @@ promise.then(value => {
})
```

If you want to convert generator function to regular function that returns a Promise use `letta.promisify`
If you want to convert generator function to regular function that returns a Promise use [letta.promisify](#promisify)

**Example**

Expand All @@ -143,7 +142,7 @@ fn(456).then(number => {
})
```

If you want to promisify **any** type of function, again, just use the `.promisify` method, like you do with [bluebird][].promisify.
If you want to promisify **any** type of function, again, just use the [.promisify](#promisify) method, like you do with [bluebird][].promisify.

```js
const fs = require('fs')
Expand Down Expand Up @@ -285,13 +284,13 @@ console.log(promise.___customPromise) // => `true` when pass `.Promise`, falsey
## Examples
> Few working examples with what can be passed and how `letta` acts.
- [Callback functions](#callback-functions)
- [Generator functions](#generator-functions)
- [JSON.stringify](#jsonstringify)
- [Synchronous functions](#synchronous-functions)
- [Exceptions and rejections](#exceptions-and-rejections)
- [Returning errors](#returning-errors)
- [Passing function as last argument](#passing-function-as-last-argument)
* [Callback functions](#callback-functions)
* [Generator functions](#generator-functions)
* [JSON.stringify](#jsonstringify)
* [Synchronous functions](#synchronous-functions)
* [Exceptions and rejections](#exceptions-and-rejections)
* [Returning errors](#returning-errors)
* [Passing function as last argument](#passing-function-as-last-argument)

### Callback functions
> Can accept asynchronous (callback) functions as well.
Expand Down Expand Up @@ -456,14 +455,14 @@ letta(regular, 'foo', 123, {a: 'b'}, function someFn () {})
```

## Related
* [callback2stream](https://www.npmjs.com/package/callback2stream): Transform sync, async or generator function to Stream. Correctly handle errors. [homepage](https://github.com/hybridables/callback2stream)
* [letta-value](https://www.npmjs.com/package/letta-value): Extends `letta` to accept and handles more than functions only. Handles all… [more](https://www.npmjs.com/package/letta-value) | [homepage](https://github.com/hybridables/letta-value)
* [mukla](https://www.npmjs.com/package/mukla): Simple and fast test runner with basic reporter and clean stacktraces. Support[more](https://www.npmjs.com/package/mukla) | [homepage](https://github.com/tunnckocore/mukla)
* [promise2stream](https://www.npmjs.com/package/promise2stream): Transform ES2015 Promise to Stream - specifically, Transform Stream using… [more](https://www.npmjs.com/package/promise2stream) | [homepage](https://github.com/hybridables/promise2stream)
* [relike-all](https://www.npmjs.com/package/relike-all): Promisify all functions in an object, using [relike][]. | [homepage](https://github.com/hybridables/relike-all)
* [relike-value](https://www.npmjs.com/package/relike-value): Create promise from sync, async, string, number, array and so on. Handle… [more](https://www.npmjs.com/package/relike-value) | [homepage](https://github.com/hybridables/relike-value)
* [relike](https://www.npmjs.com/package/relike): Simple promisify async or sync function with sane defaults. Lower level than[more](https://www.npmjs.com/package/relike) | [homepage](https://github.com/hybridables/relike)
* [value2stream](https://www.npmjs.com/package/value2stream): Transform any value to stream. Create a stream from any value -[more](https://www.npmjs.com/package/value2stream) | [homepage](https://github.com/hybridables/value2stream)
- [callback2stream](https://www.npmjs.com/package/callback2stream): Transform sync, async or generator function to Stream. Correctly handle errors and… [more](https://github.com/hybridables/callback2stream#readme) | [homepage](https://github.com/hybridables/callback2stream#readme "Transform sync, async or generator function to Stream. Correctly handle errors and optional arguments.")
- [letta-value](https://www.npmjs.com/package/letta-value): Extends `letta` to accept and handles more than functions only. Handles all… [more](https://github.com/hybridables/letta-value#readme) | [homepage](https://github.com/hybridables/letta-value#readme "Extends `letta` to accept and handles more than functions only. Handles all kind of results from `letta`. Basically, creating promise from everything - strings, arrays, objects, functions, generators, generator functions, promises, streams, child processe")
- [mukla](https://www.npmjs.com/package/mukla): Simple and fast test runner based on [async-done][] - so, works with[more](https://github.com/tunnckocore/mukla#readme) | [homepage](https://github.com/tunnckocore/mukla#readme "Simple and fast test runner based on [async-done][] - so, works with callbacks, promises, observables, child processes and streams. Shows meaningful output on fail and support for custom reporters.")
- [promise2stream](https://www.npmjs.com/package/promise2stream): Transform ES2015 Promise to Stream - specifically, Transform Stream using [through2][]. Works[more](https://github.com/hybridables/promise2stream#readme) | [homepage](https://github.com/hybridables/promise2stream#readme "Transform ES2015 Promise to Stream - specifically, Transform Stream using [through2][]. Works in object mode by default, but you can pass options directly to the [through2][] package.")
- [relike](https://www.npmjs.com/package/relike): Simple promisify async or sync function with sane defaults. Lower level than… [more](https://github.com/hybridables/relike#readme) | [homepage](https://github.com/hybridables/relike#readme "Simple promisify async or sync function with sane defaults. Lower level than `promisify` thing. Can be used to create `promisify` method.")
- [relike-all](https://www.npmjs.com/package/relike-all): Promisify all function in an object, using [relike][]. | [homepage](https://github.com/hybridables/relike-all#readme "Promisify all function in an object, using [relike][].")
- [relike-value](https://www.npmjs.com/package/relike-value): Create promise from sync, async, string, number, array and so on. Handle[more](https://github.com/hybridables/relike-value#readme) | [homepage](https://github.com/hybridables/relike-value#readme "Create promise from sync, async, string, number, array and so on. Handle completion (results) and errors gracefully! Built on top of `relike`, used by `redolent` to build robust (hybrid) APIs.")
- [value2stream](https://www.npmjs.com/package/value2stream): Transform any value to stream. Create a stream from any value… [more](https://github.com/hybridables/value2stream#readme) | [homepage](https://github.com/hybridables/value2stream#readme "Transform any value to stream. Create a stream from any value - string, array, buffer, number, promise or even Error object.")

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/hybridables/letta/issues/new).
Expand All @@ -473,6 +472,7 @@ But before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md)

[![tunnckoCore.tk][author-www-img]][author-www-url] [![keybase tunnckoCore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]

[async-done]: https://github.com/gulpjs/async-done
[bluebird]: https://github.com/petkaantonov/bluebird
[co]: https://github.com/tj/co
[common-callback-names]: https://github.com/tunnckocore/common-callback-names
Expand Down Expand Up @@ -527,3 +527,4 @@ But before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md)

[new-message-url]: https://github.com/tunnckoCore/ama
[new-message-img]: https://img.shields.io/badge/ask%20me-anything-green.svg

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"relike",
"relike-all",
"relike-value",
"through2"
"through2",
"async-done"
],
"run": true,
"toc": true,
Expand Down

0 comments on commit 820725f

Please sign in to comment.