<commit_before>'use strict';

// MODULES //

var debug = require( 'debug' )( 'readme-to-html' );
var resolve = require( 'path' ).resolve;
var writeFile = require( 'fs' ).writeFile;
var mustache = require( 'mustache' );
var isString = require( '@stdlib/utils/is-string' ).isPrimitive;
var isFunction = require( '@stdlib/utils/is-function' );
var readFile = require( '@stdlib/fs/read-file' );
var cwd = require( '@stdlib/utils/cwd' );
var copy = require( '@stdlib/utils/copy' );
var toHTML = require( './../../../markdown/to-html' );
var defaults = require( './defaults.json' );
var validate = require( './validate.js' );
var template = require( './html_template.js' );
var styles = require( './styles.js' );


// MAIN //

/**
* Converts a package README to HTML.
*
* @param {string} file - input file path
* @param {Options} [options] - options
* @param {string} [options.out] - output file path
* @param {string} [options.title] - HTML title
* @param {string} [options.tests] - tests URL
* @param {string} [options.benchmarks] - benchmarks URL
* @param {string} [options.source] - source URL
* @param {boolean} [options.fragment] - output an HTML fragment
* @param {string} [options.prepend] - content to prepend to HTML body
* @param {string} [options.append] - content to append to HTML body
* @param {string} [options.head] - content to insert into HTML head
* @param {Callback} clbk - callback to invoke after converting README
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
*/
function convert( file, options, clbk ) {
	var prepend;
	var append;
	var opts;
	var head;
	var err;
	var src;
	var dir;
	var out;
	var cb;

	if ( !isString( file ) ) {
		throw new TypeError( 'invalid input argument. First argument must be a string. Value: `'+file+'`.' );
	}<commit_msg>Add JSDoc example<commit_after>'use strict';

// MODULES //

var debug = require( 'debug' )( 'readme-to-html' );
var resolve = require( 'path' ).resolve;
var writeFile = require( 'fs' ).writeFile;
var mustache = require( 'mustache' );
var isString = require( '@stdlib/utils/is-string' ).isPrimitive;
var isFunction = require( '@stdlib/utils/is-function' );
var readFile = require( '@stdlib/fs/read-file' );
var cwd = require( '@stdlib/utils/cwd' );
var copy = require( '@stdlib/utils/copy' );
var toHTML = require( './../../../markdown/to-html' );
var defaults = require( './defaults.json' );
var validate = require( './validate.js' );
var template = require( './html_template.js' );
var styles = require( './styles.js' );


// MAIN //

/**
* Converts a package README to HTML.
*
* @param {string} file - input file path
* @param {Options} [options] - options
* @param {string} [options.out] - output file path
* @param {string} [options.title] - HTML title
* @param {string} [options.tests] - tests URL
* @param {string} [options.benchmarks] - benchmarks URL
* @param {string} [options.source] - source URL
* @param {boolean} [options.fragment] - output an HTML fragment
* @param {string} [options.prepend] - content to prepend to HTML body
* @param {string} [options.append] - content to append to HTML body
* @param {string} [options.head] - content to insert into HTML head
* @param {Callback} clbk - callback to invoke after converting README
* @throws {TypeError} first argument must be a string
* @throws {TypeError} options argument must be an object
* @throws {TypeError} must provide valid options
* @throws {TypeError} callback argument must be a function
*
* @example
* var opts = {
*     'title': 'beep boop'
* };
*
* var src = '/beep/boop/README.md';
*
* convert( src, opts, clbk );
*
* function clbk( error, html ) {
*     if ( error ) {
*         throw error;
*     }
*     console.log( html );
* }
*/
function convert( file, options, clbk ) {
	var prepend;
	var append;
	var opts;
	var head;
	var err;
	var src;
	var dir;
	var out;
	var cb;

	if ( !isString( file ) ) {
		throw new TypeError( 'invalid input argument. First argument must be a string. Value: `'+file+'`.' );
	}
{'fraction_non_alphanumeric': 0.1574746008708273, 'fraction_numerical': 0.0, 'mean_word_length': 3.84192037470726, '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': '3940001', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1311, 'n_words': 463}