<commit_before>
// another example

// usage: echo '{"type":"pit", "id":"a"}' | node stdin.js

var H = require('highland');

// read NDJSON from standard input
var stdin = H(process.stdin)

	.splitBy('\n')

	.filter(function(s){
		return s !== '';
	})

	.map(function(s){
		// diff-ish
		if(/^[+-]/.test(s))
		{
			var o = JSON.parse(s.slice(1));
			o.operation = (s[0] == '+' ? 'add' : 'remove');
			return o;
		}

		// regular obj
		return JSON.parse(s);
	});

var graphmalizer = require('./index');

graphmalizer(stdin)
	.each(H.log);<commit_msg>use future API<commit_after>
// another example

// usage: echo '{"type":"pit", "id":"a"}' | node stdin.js

var H = require('highland');

// read NDJSON from standard input
var stdin = H(process.stdin)

	.splitBy('\n')

	.filter(function(s){
		return s !== '';
	})

	.map(function(s){
		// diff-ish
		if(/^[+-]/.test(s))
		{
			var o = JSON.parse(s.slice(1));
			o.operation = (s[0] == '+' ? 'add' : 'remove');
			return o;
		}

		// regular obj
		return JSON.parse(s);
	});

var Graphmalizer = require('../index');

var G = new Graphmalizer();
G.register(stdin).each(log("OUT"));
{'fraction_non_alphanumeric': 0.23649247121346323, 'fraction_numerical': 0.00354295837023915, 'mean_word_length': 3.169741697416974, 'pattern_counts': {'":': 4, '<': 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': '5677250', 'n_tokens_mistral': 476, 'n_tokens_neox': 439, 'n_words': 94}