<commit_before># safe-instances (previously called `safe_children`)
[![Join the chat at https://gitter.im/oratio-io/safe-instances](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/oratio-io/safe-instances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A complete, functional, fast and simple Node.js threading module.

`safe-instances` was developed by Oratio.io for Oratio.js's Module System.
It's based on children pools, allowing you to

**NOTE:** With release 2.0, sending file names when doing `new Child()` is **DEPRECATED**. You must do `new ChildFile()`, as explained in the quick-start tutorial.

# Installation

`npm install safe_children`

# Getting Started

``` javascript
var Child = require('safe-instances');
var pool = new Child.Pool(3); //Creates pool with 3 processes

var child = new Child('process.handle("randomMessage", function(value, callback){ callback(value) }', pool, 3 * 60);
child.start();

child.contact('randomMessage', 'myValue') //NOTE: You might pass a third callback argument, too.
.then(function(value){<commit_msg>Adds Travis build status.<commit_after># safe-instances (previously called `safe_children`)
[![Build Status](https://travis-ci.org/oratio-io/safe-instances.svg?branch=master)](https://travis-ci.org/oratio-io/safe-instances)
[![Join the chat at https://gitter.im/oratio-io/safe-instances](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/oratio-io/safe-instances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A complete, functional, fast and simple Node.js threading module.

`safe-instances` was developed by Oratio.io for Oratio.js's Module System.
It's based on children pools, allowing you to

**NOTE:** With release 2.0, sending file names when doing `new Child()` is **DEPRECATED**. You must do `new ChildFile()`, as explained in the quick-start tutorial.

# Installation

`npm install safe_children`

# Getting Started

``` javascript
var Child = require('safe-instances');
var pool = new Child.Pool(3); //Creates pool with 3 processes

var child = new Child('process.handle("randomMessage", function(value, callback){ callback(value) }', pool, 3 * 60);
child.start();

child.contact('randomMessage', 'myValue') //NOTE: You might pass a third callback argument, too.
.then(function(value){
{'fraction_non_alphanumeric': 0.14291845493562233, 'fraction_numerical': 0.007725321888412017, 'mean_word_length': 5.736994219653179, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, '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': '2574288', 'n_tokens_mistral': 765, 'n_tokens_neox': 728, 'n_words': 208}