<commit_before># linebot

  [![NPM Version][npm-image]][npm-url]
  [![NPM Downloads][downloads-image]][downloads-url]
  [![NPM Dependencies][dependencies-image]][dependencies-url]
  [![Build][travis-image]][travis-url]

LINE Messaging API for Node.js

# About LINE Messaging API

Please refer to the official API documents for details.

https://devdocs.line.me

# Installation

```bash
$ npm install linebot --save
```

# Usage

```js
var linebot = require('linebot');

var bot = linebot({
	channelId: [CHANNEL_ID],
	channelSecret: [CHANNEL_SECRET],
	channelAccessToken: [CHANNEL_ACCESS_TOKEN]
});

bot.on('message', function (event) {
	event.reply(event.message.text).then(function (data) {
		// success
	}).catch(function (error) {
		// error
	});
});

bot.listen('/linewebhook', 3000);
```

## Using with your own Express.js server
```js
const app = express();
const linebotParser = bot.parser();
app.post('/linewebhook', linebotParser);
app.listen(3000);
``

# API

## linebot(config)
Create LineBot instance with specified configuration.
```js
var bot = linebot({
    channelId: [CHANNEL_ID],
    channelSecret: [CHANNEL_SECRET],
    channelAccessToken: [CHANNEL_ACCESS_TOKEN],
	verify: true // Verify 'X-Line-Signature' header (default=true)
});
```

## LineBot.listen(webHookPath, port, callback)

Start built-in http server on the specified `port`,
and accept POST request callback on the specified `webHookPath`.

This method is provided for convenience.
You can write you own server and use `verify` and `parse` methods to process webhook events.
See `examples/echo-express-long.js` for example.

## LineBot.verify(rawBody, signature)

Verify `X-Line-Signature` header.

## LineBot.parse(body)

Process incoming webhook request, and raise an event.<commit_msg>update readme for express parser<commit_after># linebot

  [![NPM Version][npm-image]][npm-url]
  [![NPM Downloads][downloads-image]][downloads-url]
  [![NPM Dependencies][dependencies-image]][dependencies-url]
  [![Build][travis-image]][travis-url]

LINE Messaging API for Node.js

# About LINE Messaging API

Please refer to the official API documents for details.

https://devdocs.line.me

# Installation

```bash
$ npm install linebot --save
```

# Usage

```js
var linebot = require('linebot');

var bot = linebot({
	channelId: [CHANNEL_ID],
	channelSecret: [CHANNEL_SECRET],
	channelAccessToken: [CHANNEL_ACCESS_TOKEN]
});

bot.on('message', function (event) {
	event.reply(event.message.text).then(function (data) {
		// success
	}).catch(function (error) {
		// error
	});
});

bot.listen('/linewebhook', 3000);
```

### Using with your own [Express.js][express-url] server
```js
const app = express();
const linebotParser = bot.parser();
app.post('/linewebhook', linebotParser);
app.listen(3000);
```

# API

## linebot(config)
Create LineBot instance with specified configuration.
```js
var bot = linebot({
    channelId: [CHANNEL_ID],
    channelSecret: [CHANNEL_SECRET],
    channelAccessToken: [CHANNEL_ACCESS_TOKEN],
	verify: true // Verify 'X-Line-Signature' header (default=true)
});
```

## LineBot.listen(webHookPath, port, callback)

Start built-in http server on the specified `port`,
and accept POST request callback on the specified `webHookPath`.

This method is provided for convenience.
You can write you own server and use `verify` and `parse` methods to process webhook events.
See `examples/echo-express-long.js` for example.

## LineBot.verify(rawBody, signature)

Verify `X-Line-Signature` header.

## LineBot.parse(body)

Process incoming webhook request, and raise an event.
{'fraction_non_alphanumeric': 0.14345637583892618, 'fraction_numerical': 0.0044742729306487695, 'mean_word_length': 5.021885521885522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '545718', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1134, 'n_words': 321}