<commit_before>'use strict';
var markdox = require('markdox');
var fs = require('fs');
var ejs = require('ejs');

var template = ejs.compile(
  fs.readFileSync(__dirname + '/../docs/.scripts/template.html', 'utf-8')
);
var argPackage = process.argv[2];
var dirOfThePackage = __dirname + '/../' + argPackage;

markdox.process(
  dirOfThePackage + '/lib/index.js', // src
  {
    output: dirOfThePackage + '/generated-api.md',
    template: __dirname + '/api-ref-template.md.ejs',
  },
  function generationCallback(err/*, output */) {
    if (err) {
      console.error(err);
    } else {
      console.log('File `' + dirOfThePackage + '/generated-api.md' + '` generated with success');

      var content =
        fs.readFileSync(__dirname + '/../docs/content/api/' + argPackage + '.md', 'utf-8') +
        fs.readFileSync(dirOfThePackage + '/generated-api.md', 'utf-8');

      var outputStr = template({
        title: 'API reference (' + argPackage + ')',
        pathToRoot: '../',
        content: content,
      });<commit_msg>chore(META): point make-api-docs.js to foo/lib/cjs/index.js<commit_after>'use strict';
var markdox = require('markdox');
var fs = require('fs');
var ejs = require('ejs');

var template = ejs.compile(
  fs.readFileSync(__dirname + '/../docs/.scripts/template.html', 'utf-8')
);
var argPackage = process.argv[2];
var dirOfThePackage = __dirname + '/../' + argPackage;

markdox.process(
  dirOfThePackage + '/lib/cjs/index.js', // src
  {
    output: dirOfThePackage + '/generated-api.md',
    template: __dirname + '/api-ref-template.md.ejs',
  },
  function generationCallback(err/*, output */) {
    if (err) {
      console.error(err);
    } else {
      console.log('File `' + dirOfThePackage + '/generated-api.md' + '` generated with success');

      var content =
        fs.readFileSync(__dirname + '/../docs/content/api/' + argPackage + '.md', 'utf-8') +
        fs.readFileSync(dirOfThePackage + '/generated-api.md', 'utf-8');

      var outputStr = template({
        title: 'API reference (' + argPackage + ')',
        pathToRoot: '../',
        content: content,
      });
{'fraction_non_alphanumeric': 0.18649669499527857, 'fraction_numerical': 0.003777148253068933, 'mean_word_length': 2.960747663551402, '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': '1041505', 'n_tokens_mistral': 698, 'n_tokens_neox': 693, 'n_words': 138}