function create( src ) {
	var exampleOpts;
	var comments;
	var requires;
	var comment;
	var jsdocs;
	var param;
	var tests;
	var opts;
	var tags;
	var test;
	var ast;
	var out;
	var tag;
	var h;
	var i;

	if ( isBuffer( src ) ) {
		src = src.toString();
	}
	else if ( !isString( src ) ) {
		throw new TypeError( format( 'invalid argument. Must provide either a string or Buffer. Value: `%s`.', src ) );
	}
	comments = [];
	parse( src, {
		'ecmaVersion': 'latest',
		'onComment': comments
	});
	comment = extractOptionsJSDoc( comments );
	if ( !isString( comment ) ) {
		throw new Error( 'invalid argument. Source code does not contain JSDoc comment with function options.' );
	}
	ast = doctrine.parse( comment, {
		'sloppy': true,
		'unwrap': true
	});
	tags = ast.tags;
	requires = [];
	jsdocs = [];
	tests = [];
	exampleOpts = [];
	out = VALIDATE;
	for ( i = 0; i < tags.length; i++ ) {
		tag = tags[ i ];
		if (
			isObject( tag.type ) &&
			tag.type.type === 'OptionalType' &&
			startsWith( tag.name, 'options.' )
		) {
			param = replace( tag.name, 'options.', '' );
			if ( tag.type.expression.type === 'NameExpression' ) {
				test = createTest( param, tag, requires, jsdocs, exampleOpts );
			}
			else if ( tag.type.expression.type === 'AllLiteral' ) {
				jsdocs.push( '* @param {*} [' + tag.name + '] - '+ tag.description );
				test = WILDCARD;
				test = replace( test, '{{param}}', param );
			}
			else if ( tag.type.expression.type === 'UnionType' ) {
				test = createUnionTest( param, tag, requires, jsdocs );
			}
			test = rtrim( test );
			tests.push( test );
		}
	}
	out = replace( out, '{{requires}}', requires.join( '\n' ) );
	out = replace( out, '{{exampleOpts}}', exampleOpts.join( ',\n*     ' ) );
	out = replace( out, '{{jsdocs}}', jsdocs.join( '\n' ) );
	out = replace( out, '{{tests}}', tests.join( '\n' ) );

	// Generate a license header:
	opts = {
		'year': CURRENT_YEAR,
		'copyright': 'The Stdlib Authors'
	};
	h = licenseHeader( 'Apache-2.0', 'js', opts );

	// Insert the header:
	out = insertHeader( out, h );
	return out;
}
Returns contents of a `validate.js` file.

@param {(string|Buffer)} src - source code
@throws {TypeError} must provide a string or Buffer
@throws {Error} source code must contain a JSDoc comment with options
@returns {string} validate.js contents

@example
var create = require( '@stdlib/_tools/scaffold/validate-js' );

var code = [
    '/**',
    '* Sets a nested property value.',
    '*',
    '* @param {ObjectLike} obj - input object',
    '* @param {(string|Array)} path - key path',
    '* @param {*} value - value to set',
    '* @param {Options} [options] - function options',
    '* @param {boolean} [options.create=false] - boolean indicating whether to * create a path if the key path does not already exist',
    '* @param {string} [options.sep=\'.\'] - key path separator',
    '* @returns {boolean} boolean indicating if the property was successfully set',
    '*\/'
];
code = code.join( '\n' );

var validate = create( code );