<commit_before>Antecons node.js
================

Node.js binding for the [Antecons API](https://api.antecons.net)

Installation and setup
----------------------

Download latest version:

    git clone https://github.com/antecons/antecons-node.git

Include antecons.js somewhere in your project and instantiate the API with a
config containing your API key and API secret:
    
    var Antecons = require('./lib/antecons')({
        apiKey: 'your_api_key',
        apiSecret: 'your_api_secret',
        debug: true  // To get console messages.
    });

The `debug` value is optional and should only be `true` during development and
test.

Usage example
-------------

Currently, the API is quite simple and requires manual specification of the
endpoint urls. For example, to fetch all datasources:


    Antecons.get('/datasource, null, function(datasources) {
        console.log(datasources);        
    })<commit_msg>Add example to README<commit_after>Antecons node.js
================

Node.js binding for the [Antecons API](https://api.antecons.net)

Installation and setup
----------------------

Download latest version:

    git clone https://github.com/antecons/antecons-node.git

Include antecons.js somewhere in your project and instantiate the API with a
config containing your API key and API secret:
    
    var Antecons = require('./lib/antecons')({
        apiKey: 'your_api_key',
        apiSecret: 'your_api_secret',
        debug: true  // To get console messages.
    });

The `debug` value is optional and should only be `true` during development and
test.

Usage example
-------------

Currently, the API is quite simple and requires manual specification of the
endpoint urls. For example, to fetch all datasources:


    Antecons.get('/datasource', null, function(datasources) {
        console.log(datasources);        
    });

Or to add a new datasource:

    Antecons.get('/datasource', { title: 'Test' }, function(datasources) {
        console.log(datasources);        
    });
{'fraction_non_alphanumeric': 0.1368840219014435, 'fraction_numerical': 0.0, 'mean_word_length': 2.9105058365758754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '3646499', 'n_tokens_mistral': 567, 'n_tokens_neox': 543, 'n_words': 194}