<commit_before># tchannel-promise [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status](https://coveralls.io/repos/rajeshsegu/tchannel-promise/badge.svg?branch=master&service=github)](https://coveralls.io/github/rajeshsegu/tchannel-promise?branch=master)
> tchannel promises

## Installation

```sh
$ npm install tchannel-promise --save
```

## Usage

```js
var TchannelPromise = require('tchannel-promise');

var tchannel = new TChannelPromise(options);
var channel = tchannel.makeSubChannel({serviceName: 'test'});
var promise = channel.request()
    .send('echo', 'arg1', 'arg2');
    
promise    
    .then(function success(result){
      // implement success
    }, function fail(err){
      // implement failure
    });

```

## License

 © [<NAME>](https://www.npmjs.com/~rajeshsegu)


[npm-image]: https://badge.fury.io/js/tchannel-promise.svg
[npm-url]: https://npmjs.org/package/tchannel-promise
[travis-image]: https://travis-ci.org/rajeshsegu/tchannel-promise.svg?branch=master
[travis-url]: https://travis-ci.org/rajeshsegu/tchannel-promise
[daviddm-image]: https://david-dm.org/rajeshsegu/tchannel-promise.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/rajeshsegu/tchannel-promise
[coveralls-image]: https://coveralls.io/repos/rajeshsegu/tchannel-promise/badge.svg
[coveralls-url]: https://coveralls.io/r/rajeshsegu/tchannel-promise
<commit_msg>update example<commit_after># tchannel-promise [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status](https://coveralls.io/repos/rajeshsegu/tchannel-promise/badge.svg?branch=master&service=github)](https://coveralls.io/github/rajeshsegu/tchannel-promise?branch=master)
> tchannel promises

tchannel-promise wraps tchannel send() to return a bluebird promise. 

## Installation

```sh
$ npm install tchannel-promise --save
```

## Usage

```js
var TchannelPromise = require('tchannel-promise');

var tchannel = new TChannelPromise(options);

var testChannel = tchannel
      .makeSubChannel({serviceName: 'test'});

var bluebirdPromise = testChannel
	.request()
    .send('echo', 'arg1', 'arg2');
    
bluebirdPromise    
    .then(function onSuccess(result){
      // handle successful result    
      // result.response
      // result.arg2
      // result.arg3
    }, function onFailure(err){
      // handle error err
    })
    .catch(function onException(ex){
      // handle exception ex
    });

```

## License

 © [<NAME>](https://www.npmjs.com/~rajeshsegu)


[npm-image]: https://badge.fury.io/js/tchannel-promise.svg
[npm-url]: https://npmjs.org/package/tchannel-promise
[travis-image]: https://travis-ci.org/rajeshsegu/tchannel-promise.svg?branch=master
[travis-url]: https://travis-ci.org/rajeshsegu/tchannel-promise
[daviddm-image]: https://david-dm.org/rajeshsegu/tchannel-promise.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/rajeshsegu/tchannel-promise
[coveralls-image]: https://coveralls.io/repos/rajeshsegu/tchannel-promise/badge.svg
[coveralls-url]: https://coveralls.io/r/rajeshsegu/tchannel-promise

{'fraction_non_alphanumeric': 0.17170418006430868, 'fraction_numerical': 0.0019292604501607716, 'mean_word_length': 4.605405405405405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 22, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4341896', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1084, 'n_words': 148}