function datapackage( files ) {
	var fpath;
	var parts;
	var name;
	var obj;
	var pkg;
	var arr;
	var ext;
	var re;
	var yr;
	var i;

	fpath = join( __dirname, '..', 'datapackage.json' );
	pkg = require( fpath ); // eslint-disable-line stdlib/no-dynamic-require

	re = /[_.]/g;

	arr = [];
	for ( i = 0; i < files.length; i++ ) {
		ext = extname( files[ i ] );
		parts = files[ i ].match( RE );
		yr = parseInt( parts[ 1 ], 10 );
		name = unsnakecase( parts[ 2 ] );
		obj = {
			'name': replace( files[ i ], re, '-' ),
			'title': 'State of the Union Address',
			'description': 'State of the Union address given by '+name+' in '+yr+'.',
			'format': '',
			'mediatype': '',
			'encoding': 'UTF-8',
			'hash': '',
			'path': './data/'+files[ i ]
		};
		if ( ext === '.txt' ) {
			obj.format = 'text';
			obj.mediatype = 'plain/text';
		} else if ( ext === '.json' ) {
			obj.format = 'json';
			obj.mediatype = 'application/json';
		}
		arr.push( obj );
	}
	pkg.resources = arr;
	pkg = JSON.stringify( pkg, null, '  ' );

	debug( 'Writing data package to file: %s', fpath );
	writeFileFcn( fpath, pkg+'\n', OPTS, onWritePkg );
}
Updates a `datapackage.json` file.

@private
@param {StringArray} files - file names