lib/index.js
function getBanner (options) {
  if (!options.banner) {
    if (typeof options.pkg === "string") {
      // Read the package.json file
      options.pkg = readJSON(options.pkg);
    }

    if (!options.template) {
      // Read the banner template from a file
      options.template = findFile(options.file);
    }

    if (options.template) {
      // Compile the banner template
      options.banner = _.template(options.template)({ moment, pkg: options.pkg, });

      // Convert the banner to a comment block, if it's not already
      if (!/^\s*(\/\/|\/\*)/.test(options.banner)) {
        options.banner = "/*!\n * " + options.banner.trim().replace(/\n/g, "\n * ") + "\n */\n";
      }
    }
  }

  return options.banner;
}
function getBanner (options) {
  if (!options.banner) {
    if (typeof options.pkg === "string") {
      // Read the package.json file
      options.pkg = readJSON(options.pkg);
    }

    if (!options.template) {
      // Read the banner template from a file
      options.template = findFile(options.file);
    }

    if (options.template) {
      // Compile the banner template
      options.banner = _.template(options.template)({ moment, pkg: options.pkg, });

      // Convert the banner to a comment block, if it's not already
      if (!/^\s*(\/\/|\/\*)/.test(options.banner)) {
        options.banner = "/*!\n * " + options.banner.trim().replace(/\n/g, "\n * ") + "\n */\n";
      }
    }
  }

  return options.banner;
}
function getBanner ( options ) { if ( ! options . banner ) { if ( typeof options . pkg === "string" ) { // Read the package.json file options . pkg = readJSON ( options . pkg ) ; } if ( ! options . template ) { // Read the banner template from a file options . template = findFile ( options . file ) ; } if ( options . template ) { // Compile the banner template options . banner = _ . template ( options . template ) ( { moment , pkg : options . pkg , } ) ; // Convert the banner to a comment block, if it's not already if ( ! / ^\s*(\/\/|\/\*) / . test ( options . banner ) ) { options . banner = "/*!\n * " + options . banner . trim ( ) . replace ( / \n / g , "\n * " ) + "\n */\n" ; } } } return options . banner ; }
Returns the banner comment block, based on the given options

@param {object} options
@param {string} [options.banner] - If set, then this banner will be used exactly as-is
@param {string} [options.template] - A Lodash template that will be compiled to build the banner
@param {string} [options.file] - A file containing the Lodash template
@param {string|object} [options.pkg] - The path (or parsed contents) of the package.json file

@returns {string|undefiend}
Returns the banner comment block based on the given options