Skip to content

Commit

Permalink
updating readme with async await info
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jan 17, 2017
1 parent 6920274 commit 0defc3d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -6,7 +6,17 @@ koa-hbs [![Build Status][travis-badge]][repo-url]
> **_ATTENTION_**: This is the `@next` version of koa-hbs, specifically for use with
Koa v2 or higher. This branch will not work with Koa v1.x.

## Async / Await

This branch assumes native `async/await` support. At present only Node v7 or
higher can natively support the pattern. However, you must use a `--harmony-async-await`

This comment has been minimized.

Copy link
@mgol

mgol Mar 30, 2017

This paragraph seems to contradict itself. Either Node 7 supports async/await natively or it requires experimental flags.

In fact, Node 7.6.0 and newer support async/await natively (previous v7 versions didn't) and no flags are required.

This comment has been minimized.

Copy link
@mgol

mgol Mar 30, 2017

In fact, that's what you can see in Node 7.6.0 or newer in node --v8-options:

  --harmony_async_await (enable "harmony async-await")
        type: bool  default: true

so this flag is already turned on.

This comment has been minimized.

Copy link
@shellscape

shellscape Mar 30, 2017

Author Contributor

reference the date of the commit, prior to 7.6.0. not sure why you chose to bikeshed this, but a component/app/program/script can have native support for a feature with which a flag is required to activate it. I appreciate the interest in the module, but this could have been a new issue requesting an update to README, or a really simple PR, rather than the pair of comments (we do have an edit button for comments too) on an old commit.

This comment has been minimized.

Copy link
@mgol

mgol Mar 31, 2017

I submitted a PR with relevant changes: #65.

flag on the command line while running your app, or programmatically. We
recommend using [harmonica](https://www.npmjs.com/package/harmonica) to enable
the `--harmony` flags programmatically. An example pattern for using `harmonica`
can be found in this branch's [gulpfile.js](gulpfile.js).

## Usage

koa-hbs is middleware. We stash an instance of koa-hbs for you in the library
so you don't have to manage it separately. Configure the default instance by
passing an [options](#options) hash to #middleware. To render a template then,
Expand Down

0 comments on commit 0defc3d

Please sign in to comment.