<commit_before># [gulp](http://gulpjs.com)-render &nbsp; [![Build Status](http://img.shields.io/travis/koistya/gulp-render/master.svg?style=flat)](http://travis-ci.org/koistya/gulp-render) [![Dependency Status](https://david-dm.org/koistya/gulp-render.svg?style=flat)](https://david-dm.org/koistya/gulp-render) [![Tips](http://img.shields.io/gratipay/koistya.svg?style=flat)](https://gratipay.com/koistya) [![Gitter](http://img.shields.io/badge/chat-online-brightgreen.svg?style=flat)](https://gitter.im/kriasoft/react-starter-kit)

> Pre-render [React](https://facebook.github.io/react/) components at compile time.

[![NPM](https://nodei.co/npm/gulp-render.png?compact=true)](https://www.npmjs.org/package/gulp-render)

## How to Install

```sh
$ npm install gulp-render --save-dev
```

## How to Use

#### Example 1:

```js
var gulp = require('gulp');
var render = require('gulp-render');

gulp.task('default', function() {
  return gulp.src('src/pages/**/*.jsx')
    .pipe(render({template: 'src/pages/_template.html'}))
    .pipe(gulp.dest('build'));
});
```

#### Example 2:

```js
var gulp = require('gulp');
var render = require('gulp-render');

gulp.task('default', function() {
  return gulp.src('src/pages/**/*.jsx')
    .pipe(render({
      template:
        '<!doctype html>' +
        '<html><head><title><%=title%></title></head>' +
        '<body><%=body%></body></html>',
      harmony: false
    }))
    .pipe(gulp.dest('build'));
});
```

#### React Component Sample (`src/pages/SomePage.jsx`)

```jsx
/**
 * @jsx React.DOM
 */

var React = require('react');
var DefaultLayout = require('../layouts/DefaultLayout.jsx');

var SomePage = React.createClass({
  getDefaultProps() {
    return {
      title: 'Some Page'
    }
  },
  render() {
    return (
      <DefaultLayout title={this.props.title}">
        <div className="container">
          <h1>React Component Sample</h1>
          <p>Lorem ipsum dolor sit amet.</p>
        </div>
      </DefaultLayout>
    );
  }
});

module.exports = SomePage;
```

## API

#### `render(options)`

option | values | default
-------|--------|---------
`template` | [Lo-Dash template](http://lodash.com/docs#template) string or filename | `null`
`harmony` | `true`: enable ES6 features | `true`
`hyphenate` | `true`: SomePage.jsx -> some-page.html | `true`

## Related Projects

[React.js Starter Kit](https://github.com/kriasoft/react-starter-kit)

## License

The MIT License (MIT) @ <NAME> ([@koistya](https://twitter.com/koistya))<commit_msg>Fix a typo in README.md<commit_after># [gulp](http://gulpjs.com)-render &nbsp; [![Build Status](http://img.shields.io/travis/koistya/gulp-render/master.svg?style=flat)](http://travis-ci.org/koistya/gulp-render) [![Dependency Status](https://david-dm.org/koistya/gulp-render.svg?style=flat)](https://david-dm.org/koistya/gulp-render) [![Tips](http://img.shields.io/gratipay/koistya.svg?style=flat)](https://gratipay.com/koistya) [![Gitter](http://img.shields.io/badge/chat-online-brightgreen.svg?style=flat)](https://gitter.im/kriasoft/react-starter-kit)

> Pre-render [React](https://facebook.github.io/react/) components at compile time.

[![NPM](https://nodei.co/npm/gulp-render.png?compact=true)](https://www.npmjs.org/package/gulp-render)

## How to Install

```sh
$ npm install gulp-render --save-dev
```

## How to Use

#### Example 1:

```js
var gulp = require('gulp');
var render = require('gulp-render');

gulp.task('default', function() {
  return gulp.src('src/pages/**/*.jsx')
    .pipe(render({template: 'src/pages/_template.html'}))
    .pipe(gulp.dest('build'));
});
```

#### Example 2:

```js
var gulp = require('gulp');
var render = require('gulp-render');

gulp.task('default', function() {
  return gulp.src('src/pages/**/*.jsx')
    .pipe(render({
      template:
        '<!doctype html>' +
        '<html><head><title><%=title%></title></head>' +
        '<body><%=body%></body></html>',
      harmony: false
    }))
    .pipe(gulp.dest('build'));
});
```

#### React Component Sample (`src/pages/SomePage.jsx`)

```jsx
/**
 * @jsx React.DOM
 */

var React = require('react');
var DefaultLayout = require('../layouts/DefaultLayout.jsx');

var SomePage = React.createClass({
  getDefaultProps() {
    return {
      title: 'Some Page'
    }
  },
  render() {
    return (
      <DefaultLayout title={this.props.title}>
        <div className="container">
          <h1>React Component Sample</h1>
          <p>Lorem ipsum dolor sit amet.</p>
        </div>
      </DefaultLayout>
    );
  }
});

module.exports = SomePage;
```

## API

#### `render(options)`

option | values | default
-------|--------|---------
`template` | [Lo-Dash template](http://lodash.com/docs#template) string or filename | `null`
`harmony` | `true`: enable ES6 features | `true`
`hyphenate` | `true`: SomePage.jsx -> some-page.html | `true`

## Related Projects

[React.js Starter Kit](https://github.com/kriasoft/react-starter-kit)

## License

The MIT License (MIT) @ <NAME> ([@koistya](https://twitter.com/koistya))
{'fraction_non_alphanumeric': 0.22655783396376666, 'fraction_numerical': 0.001990842126219391, 'mean_word_length': 3.6691449814126393, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, 'https://': 18, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7400725', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1793, 'n_words': 281}