<commit_before>'use strict';

var registryUrl = require('registry-url')(),
    got = require('got'),
    MdAst = require('mdast'),
    mdastMan = require('mdast-man'),
    mdastStripBadges = require('mdast-strip-badges');


module.exports = function (name, opts, cb) {
  if (typeof opts == 'function') {
    cb = opts;
    opts = {};
  }

  if (opts.man == null) {
    opts.man = true;
  }

  var mdast = MdAst;

  got(registryUrl + name, { json: true }, function (err, pkg) {
    if (err) return cb(err);

    if (opts.man) {
      mdast = mdast.use(mdastStripBadges)
        .use(mdastMan, {
          section: 'npm',
          name: pkg.name,
          version: pkg.version,
          description: pkg.description
        });
    }

    cb(err, mdast.process(pkg.readme));
  });
};
<commit_msg>Fix man page date<commit_after>'use strict';

var registryUrl = require('registry-url')(),
    got = require('got'),
    MdAst = require('mdast'),
    mdastMan = require('mdast-man'),
    mdastStripBadges = require('mdast-strip-badges');


module.exports = function (name, opts, cb) {
  if (typeof opts == 'function') {
    cb = opts;
    opts = {};
  }

  if (opts.man == null) {
    opts.man = true;
  }

  var mdast = MdAst;

  got(registryUrl + name, { json: true }, function (err, pkg) {
    if (err) return cb(err);

    if (opts.man) {
      mdast = mdast.use(mdastStripBadges)
        .use(mdastMan, {
          section: 'npm',
          name: pkg.name,
          version: pkg.version,
          description: pkg.description,
          date: pkg.time.modified
        });
    }

    cb(err, mdast.process(pkg.readme));
  });
};

{'fraction_non_alphanumeric': 0.16411512553582364, 'fraction_numerical': 0.0, 'mean_word_length': 2.404166666666667, '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': '1899954', 'n_tokens_mistral': 583, 'n_tokens_neox': 559, 'n_words': 123}