async-helpers
Advanced tools
Comparing version 0.3.16 to 0.3.17
10
index.js
@@ -11,3 +11,2 @@ /*! | ||
var typeOf = require('kind-of'); | ||
var define = require('define-property'); | ||
var co = require('co'); | ||
@@ -192,3 +191,2 @@ | ||
* @param {Function} `fn` The actual helper function | ||
* @param {Object} `context` Context | ||
* @return {String} Returns an async ID to use for resolving the value. ex: `{$ASYNCID$!$8$}` | ||
@@ -552,2 +550,10 @@ */ | ||
function define(obj, key, val) { | ||
Object.defineProperty(obj, key, { | ||
configurable: true, | ||
enumerable: false, | ||
value: val | ||
}); | ||
} | ||
/** | ||
@@ -554,0 +560,0 @@ * Expose `AsyncHelpers` |
{ | ||
"name": "async-helpers", | ||
"description": "Use async helpers in templates with engines that typically only handle sync helpers. Handlebars and Lodash have been tested.", | ||
"version": "0.3.16", | ||
"version": "0.3.17", | ||
"homepage": "https://github.com/doowb/async-helpers", | ||
@@ -29,3 +29,2 @@ "author": "Brian Woodward (https://github.com/doowb)", | ||
"co": "^4.6.0", | ||
"define-property": "^1.0.0", | ||
"kind-of": "^6.0.0" | ||
@@ -80,2 +79,2 @@ }, | ||
} | ||
} | ||
} |
@@ -1,7 +0,5 @@ | ||
# async-helpers [](https://www.npmjs.com/package/async-helpers) [](https://npmjs.org/package/async-helpers) [](https://npmjs.org/package/async-helpers) [](https://travis-ci.org/doowb/async-helpers) [](https://ci.appveyor.com/project/doowb/async-helpers) | ||
# async-helpers [](https://www.npmjs.com/package/async-helpers) [](https://npmjs.org/package/async-helpers) [](https://npmjs.org/package/async-helpers) [](https://travis-ci.org/doowb/async-helpers) [](https://ci.appveyor.com/project/doowb/async-helpers) | ||
> Use async helpers in templates with engines that typically only handle sync helpers. Handlebars and Lodash have been tested. | ||
Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support. | ||
## Install | ||
@@ -15,2 +13,8 @@ | ||
Install with [yarn](https://yarnpkg.com): | ||
```sh | ||
$ yarn add async-helpers | ||
``` | ||
## Usage | ||
@@ -24,3 +28,3 @@ | ||
### [AsyncHelpers](index.js#L34) | ||
### [AsyncHelpers](index.js#L32) | ||
@@ -40,3 +44,3 @@ Create a new instance of AsyncHelpers | ||
### [.set](index.js#L71) | ||
### [.set](index.js#L69) | ||
@@ -59,3 +63,3 @@ Add a helper to the cache. | ||
### [.get](index.js#L107) | ||
### [.get](index.js#L105) | ||
@@ -77,3 +81,3 @@ Get all helpers or a helper with the given name. | ||
### [.wrapHelper](index.js#L127) | ||
### [.wrapHelper](index.js#L125) | ||
@@ -94,3 +98,3 @@ Wrap a helper with async handling capibilities. | ||
### [.reset](index.js#L235) | ||
### [.reset](index.js#L232) | ||
@@ -107,3 +111,3 @@ Reset all the stashed helpers. | ||
### [.resolveId](index.js#L284) | ||
### [.resolveId](index.js#L281) | ||
@@ -129,3 +133,3 @@ Resolve a stashed helper by the generated id. This is a generator function and should be used with [co](https://github.com/tj/co) | ||
### [.resolveIds](index.js#L426) | ||
### [.resolveIds](index.js#L423) | ||
@@ -150,23 +154,24 @@ After rendering a string using wrapped async helpers, use `resolveIds` to invoke the original async helpers and replace the async ids with results from the async helpers. | ||
<details> | ||
<summary><strong>Contributing</strong></summary> | ||
### Related projects | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). | ||
* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") | ||
* [generate](https://www.npmjs.com/package/generate): Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the… [more](https://github.com/generate/generate) | [homepage](https://github.com/generate/generate "Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.") | ||
* [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine… [more](https://github.com/jonschlinkert/templates) | [homepage](https://github.com/jonschlinkert/templates "System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.") | ||
* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") | ||
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") | ||
</details> | ||
### Contributing | ||
<details> | ||
<summary><strong>Running Tests</strong></summary> | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). | ||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: | ||
### Contributors | ||
```sh | ||
$ npm install && npm test | ||
``` | ||
| **Commits** | **Contributor** | | ||
| --- | --- | | ||
| 85 | [doowb](https://github.com/doowb) | | ||
| 44 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 1 | [nknapp](https://github.com/nknapp) | | ||
</details> | ||
### Building docs | ||
<details> | ||
<summary><strong>Building docs</strong></summary> | ||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ | ||
@@ -180,22 +185,10 @@ | ||
</details> | ||
### Running tests | ||
### Related projects | ||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: | ||
You might also be interested in these projects: | ||
```sh | ||
$ npm install && npm test | ||
``` | ||
* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") | ||
* [generate](https://www.npmjs.com/package/generate): Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the… [more](https://github.com/generate/generate) | [homepage](https://github.com/generate/generate "Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.") | ||
* [templates](https://www.npmjs.com/package/templates): System for creating and managing template collections, and rendering templates with any node.js template engine… [more](https://github.com/jonschlinkert/templates) | [homepage](https://github.com/jonschlinkert/templates "System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.") | ||
* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") | ||
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") | ||
### Contributors | ||
| **Commits** | **Contributor** | | ||
| --- | --- | | ||
| 85 | [doowb](https://github.com/doowb) | | ||
| 34 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 1 | [nknapp](https://github.com/nknapp) | | ||
### Author | ||
@@ -215,2 +208,2 @@ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 05, 2017._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 13, 2017._ |
2
485
23493
198
- Removeddefine-property@^1.0.0
- Removeddefine-property@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@1.0.3(transitive)