<commit_before>'use strict';


let q = require('q'),
	fs = require('fs');

let promise1 = new q(7),
	promise2 = q.fcall(function(){
		return 7;
	}),

	readFileQ = q.denodeify(fs.readFile),
	promise3 = readFileQ('index.php', 'utf8');

promise3.then(function(contents){
	console.log(contents);
	return readFileQ('test.js', 0);
}).then(function(contents){
	console.log(contents);
}).fail(function(err){
	console.log('fail promise run !');
	console.log(err.message);
});


function addVal (a, b) {
	return a + b;
}
let addFunc = q.denodeify(addVal),
	promise4 = addFunc(1, 2);
promise4.then(function(res){
	console.log(res);
	return res + 1;
}).then(function(res){
	console.log(res);
	return res + 1;
});<commit_msg>try use q library<commit_after>'use strict';


let q = require('q'),
	fs = require('fs');

let promise1 = new q(7),
	promise2 = q.fcall(function(){
		return 7;
	}),

	readFileQ = q.denodeify(fs.readFile),
	promise3 = readFileQ('index.php', 'utf8');

promise3.then(function(contents){
	console.log(contents);
	return readFileQ('test.js', 0);
}).then(function(contents){
	console.log(contents);
}).fail(function(err){
	console.log('fail promise run !');
	console.log(err.message);
});


function addVal (a, b) {
	console.log(a , b);
	return a + b;
}
let addFunc = q.denodeify(addVal),
	promise4 = addFunc(1, 2);
promise4.then(function(res){
	console.log(res);
	return res + 1;
}).then(function(res){
	console.log(res);
	return res + 1;
});
{'fraction_non_alphanumeric': 0.19806763285024154, 'fraction_numerical': 0.01932367149758454, 'mean_word_length': 5.118143459915612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5343213', 'n_tokens_mistral': 578, 'n_tokens_neox': 559, 'n_words': 115}