mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Use { encoding: 'utf8' } instead of 'utf8'
This commit is contained in:
parent
dc9a66c2b3
commit
75817c2e25
@ -369,7 +369,7 @@ template.render({
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var template = require('marko').load('template.marko');
|
var template = require('marko').load('template.marko');
|
||||||
var out = require('fs').createWriteStream('index.html', 'utf8');
|
var out = require('fs').createWriteStream('index.html', {encoding: 'utf8'});
|
||||||
|
|
||||||
// Render the template to 'index.html'
|
// Render the template to 'index.html'
|
||||||
template.stream({
|
template.stream({
|
||||||
@ -383,7 +383,7 @@ Alternatively, you can render directly to an existing stream to avoid creating a
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var template = require('marko').load('template.marko');
|
var template = require('marko').load('template.marko');
|
||||||
var out = require('fs').createWriteStream('index.html', 'utf8');
|
var out = require('fs').createWriteStream('index.html', {encoding: 'utf8'});
|
||||||
|
|
||||||
// Render the template to 'index.html'
|
// Render the template to 'index.html'
|
||||||
template.render({
|
template.render({
|
||||||
@ -414,7 +414,7 @@ var fs = require('fs');
|
|||||||
var marko = require('marko');
|
var marko = require('marko');
|
||||||
var template = marko.load('template.marko');
|
var template = marko.load('template.marko');
|
||||||
|
|
||||||
var out = marko.createWriter(fs.createWriteStream('index.html', 'utf8'));
|
var out = marko.createWriter(fs.createWriteStream('index.html', {encoding: 'utf8'}));
|
||||||
|
|
||||||
// Render the first chunk asynchronously (after 1s delay):
|
// Render the first chunk asynchronously (after 1s delay):
|
||||||
var asyncOut = out.beginAsync();
|
var asyncOut = out.beginAsync();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user