src/index.js
function concatFiles() {
	return Promise.all(argv._.map(handleGlob)).then(globs => {
		const files = globs.reduce((acc, cur) => acc.concat(cur), []);

		if (
			(files.length < 2 && typeof argv.banner === 'undefined' && !argv.footer) ||
			(files.length === 0 && (typeof argv.banner === 'undefined' || !argv.footer))
		) {
			throw new Error(
				chalk.bold.red('Require at least 2 file, banner or footer to concatenate. ("ncat --help" for help)\n')
			);
		}
		return files.forEach(file => {
			concat.add(file.file, file.content, file.map);
		});
	});
}
function concatFiles() {
	return Promise.all(argv._.map(handleGlob)).then(globs => {
		const files = globs.reduce((acc, cur) => acc.concat(cur), []);

		if (
			(files.length < 2 && typeof argv.banner === 'undefined' && !argv.footer) ||
			(files.length === 0 && (typeof argv.banner === 'undefined' || !argv.footer))
		) {
			throw new Error(
				chalk.bold.red('Require at least 2 file, banner or footer to concatenate. ("ncat --help" for help)\n')
			);
		}
		return files.forEach(file => {
			concat.add(file.file, file.content, file.map);
		});
	});
}
function concatFiles ( ) { return Promise . all ( argv . _ . map ( handleGlob ) ) . then ( globs => { const files = globs . reduce ( ( acc , cur ) => acc . concat ( cur ) , [ ] ) ; if ( ( files . length < 2 && typeof argv . banner === 'undefined' && ! argv . footer ) || ( files . length === 0 && ( typeof argv . banner === 'undefined' || ! argv . footer ) ) ) { throw new Error ( chalk . bold . red ( 'Require at least 2 file, banner or footer to concatenate. ("ncat --help" for help)\n' ) ) ; } return files . forEach ( file => { concat . add ( file . file , file . content , file . map ) ; } ) ; } ) ; }
Concatenate the files in order.
Exit process with error if there is less than two files, banner or footer to concatenate.

@return {Promise<Any>} Promise that resolve once the files have been read/created and concatenated.
Concatenate the files in order . Exit process with error if there is less than two files banner or footer to concatenate .