<commit_before># cronofy-node

A simple wrapper for the [Cronofy API](https://www.cronofy.com/developers/api/).

## Basic Usage

The APIs should be one to one with the all of the current methods in [Cronofy's documentation](https://www.cronofy.com/developers/api/). The general pattern is that each method takes an options object and an optional callback. If a callback is not passed in as the second argument the function will act as a promise.

#### Usage Example

```node
var cronofy = require('cronofy');

var options = {
  client_id: 'armzr1h5NPQST93XTFL9iIULXxfdDlmV',
  client_secret: 'aPPwd-ASDFAsdfasdfasdfsadfasdfASDFSADF_asdfasdfasdf',
  grant_type: 'authorization_code',
  code: 'asdkfj213sdf',
  redirect_uri: 'https://www.yoursite.com/calendar_redirect_page'
};

cronofy.requestAccessToken(options)
  .then(function(response){
    console.log(response);
  });

// Alternatively as a callback
cronofy.requestAccessToken(options, function(err, response){
  if(err) throw err;
  console.log(response);
})
```<commit_msg>Add Cronofy function call to readme<commit_after># cronofy-node

A simple wrapper for the [Cronofy API](https://www.cronofy.com/developers/api/).

## Basic Usage

The APIs should be one to one with the all of the current methods in [Cronofy's documentation](https://www.cronofy.com/developers/api/). The general pattern is that each method takes an options object and an optional callback. If a callback is not passed in as the second argument the function will act as a promise.

#### Usage Example

```node
var cronofy = require('cronofy')();

var options = {
  client_id: 'armzr1h5NPQST93XTFL9iIULXxfdDlmV',
  client_secret: 'aPPwd-ASDFAsdfasdfasdfsadfasdfASDFSADF_asdfasdfasdf',
  grant_type: 'authorization_code',
  code: 'asdkfj213sdf',
  redirect_uri: 'https://www.yoursite.com/calendar_redirect_page'
};

cronofy.requestAccessToken(options)
  .then(function(response){
    console.log(response);
  });

// Alternatively as a callback
cronofy.requestAccessToken(options, function(err, response){
  if(err) throw err;
  console.log(response);
})
```
{'fraction_non_alphanumeric': 0.1112176414189837, 'fraction_numerical': 0.007670182166826462, 'mean_word_length': 5.248502994011976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, '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': '4272989', 'n_tokens_mistral': 735, 'n_tokens_neox': 709, 'n_words': 191}