tasks/npmcopy.js
function getMain(src, options, dest) {
    var meta = grunt.file.readJSON(path.join(src, 'package.json'))
    if (!meta.main) {
      fail.fatal(
        'No main property specified by ' + path.normalize(src.replace(options.srcPrefix, ''))
      )
    }
    var files = typeof meta.main === 'string' ? [meta.main] : meta.main
    return files.map(function(source) {
      return {
        src: path.join(src, source),
        dest: dest
      }
    })
  }
function getMain(src, options, dest) {
    var meta = grunt.file.readJSON(path.join(src, 'package.json'))
    if (!meta.main) {
      fail.fatal(
        'No main property specified by ' + path.normalize(src.replace(options.srcPrefix, ''))
      )
    }
    var files = typeof meta.main === 'string' ? [meta.main] : meta.main
    return files.map(function(source) {
      return {
        src: path.join(src, source),
        dest: dest
      }
    })
  }
function getMain ( src , options , dest ) { var meta = grunt . file . readJSON ( path . join ( src , 'package.json' ) ) if ( ! meta . main ) { fail . fatal ( 'No main property specified by ' + path . normalize ( src . replace ( options . srcPrefix , '' ) ) ) } var files = typeof meta . main === 'string' ? [ meta . main ] : meta . main return files . map ( function ( source ) { return { src : path . join ( src , source ) , dest : dest } } ) }
Get the main files for a particular package
@param {string} src
@param {Object} options
@param {string} dest
@returns {Array} Returns an array of file locations from the main property
Get the main files for a particular package