Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
popeindustries committed Oct 18, 2019
1 parent 8ad6981 commit 9bada93
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ html`
`;
```
### `renderToStream(TemplateResult): Readable`
> The following render methods accept an `options` object with the following properties:
>
> - **`serializePropertyAttributes: boolean`** - enable `JSON.stringify` of property attribute values (default: `false`)
### `renderToStream(result: TemplateResult, options: RenderOptions): Readable`
Returns the result of the template tagged by `html` as a Node.js `Readable` stream of markup:
Expand All @@ -199,7 +203,7 @@ renderToStream(
).pipe(response);
```
### `renderToString(TemplateResult): Promise<string>`
### `renderToString(result: TemplateResult, options: RenderOptions): Promise<string>`
Returns the result of the template tagged by `html` as a Promise which resolves to a string of markup:
Expand All @@ -215,7 +219,7 @@ const markup = await renderToString(
response.end(markup);
```
### `renderToBuffer(TemplateResult): Promise<Buffer>`
### `renderToBuffer(result: TemplateResult, options: RenderOptions): Promise<Buffer>`
Returns the result of the template tagged by `html` as a Promise which resolves to a Buffer of markup:
Expand Down Expand Up @@ -335,13 +339,19 @@ html`
//=> <input type="checkbox" > if falsey
```
- property (attribute markup removed):
- property (attribute markup removed unless `RenderOptions.serializePropertyAttributes = true` ):
```js
const value = { some: 'text' };
html`
<input .value="${value}" />
`;
//=> <input />
html`
<input .value="${value}" />
`;
//=> <input .value="{&quot;some&quot;:&quot;text&quot;}"/>
// (when render options.serializePropertyAttributes = true)
```
- event handler (attribute markup removed):
Expand Down

0 comments on commit 9bada93

Please sign in to comment.