packages/yhtml5-cli/demo/lib/options.js
function getMetadata (dir) {
  var json = path.join(dir, 'meta.json')
  var js = path.join(dir, 'meta.js')
  var opts = {}

  if (exists(json)) {
    opts = metadata.sync(json)
  } else if (exists(js)) {
    var req = require(path.resolve(js))
    if (req !== Object(req)) {
      throw new Error('meta.js needs to expose an object')
    }
    opts = req
  }

  return opts
}
function getMetadata (dir) {
  var json = path.join(dir, 'meta.json')
  var js = path.join(dir, 'meta.js')
  var opts = {}

  if (exists(json)) {
    opts = metadata.sync(json)
  } else if (exists(js)) {
    var req = require(path.resolve(js))
    if (req !== Object(req)) {
      throw new Error('meta.js needs to expose an object')
    }
    opts = req
  }

  return opts
}
function getMetadata ( dir ) { var json = path . join ( dir , 'meta.json' ) var js = path . join ( dir , 'meta.js' ) var opts = { } if ( exists ( json ) ) { opts = metadata . sync ( json ) } else if ( exists ( js ) ) { var req = require ( path . resolve ( js ) ) if ( req !== Object ( req ) ) { throw new Error ( 'meta.js needs to expose an object' ) } opts = req } return opts }
Gets the metadata from either a meta.json or meta.js file.

@param  {String} dir
@return {Object}
Gets the metadata from either a meta . json or meta . js file .