<commit_before>var fs = require('fs')
var util = require('util')
var dvbtee = require('../build/Release/dvbtee.node')

var filename

if (process.argv.length <= 2) {
  filename = 'sample.ts'
} else {
  filename = process.argv[2]
}

var parser = new dvbtee.Parser

parser.listenTables(function(a,b,data) {
  console.log('\ntable data:\n', util.inspect(data, false, null))
})

fs.readFile(filename, function(err, buf) {

    console.log('pushing ' + buf.length + ' bytes')

    parser.feed(buf, buf.length, function(err, status) {

      if (err)
          console.log(err)<commit_msg>examples/pushfile.js: update to work with new module<commit_after>var fs = require('fs')
var util = require('util')
var dvbtee = require('../build/Release/dvbtee.node')

var filename

if (process.argv.length <= 2) {
  filename = 'sample.ts'
} else {
  filename = process.argv[2]
}

var parser = new dvbtee.Parser

fs.readFile(filename, function(err, buf) {

    console.log('pushing ' + buf.length + ' bytes')

    parser.feed(buf, buf.length, function(a,b,data) {

      console.log('\ntable data:\n', util.inspect(data, false, null))

    }, function(err, status) {

      if (err)
          console.log(err)
{'fraction_non_alphanumeric': 0.16526845637583892, 'fraction_numerical': 0.003355704697986577, 'mean_word_length': 3.642023346303502, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4185742', 'n_tokens_mistral': 422, 'n_tokens_neox': 411, 'n_words': 89}