src/lib/mangonel.js
function Mangonel (modules = []) {
  const getLaunchersByName = (modules, name) =>
    modules.filter(m => m.name === name)

  const getFirstLauncher = (...args) =>
    modules.filter(m => m.platforms.filter(p => p === args[1]).length > 0)[0]

  return {
    /**
   *
   *
   * @param {function} emulator launcher modules
   * @param {Object} [launcher={}] launcher object
   * @param {Object} [options={}] options object
   * @returns {int} processId
   */
    launch (software, launcher = {}, settings = {}, options = {}) {
      const command = getFirstLauncher(modules, software.platform).buildCommand(
        software.file,
        launcher,
        settings
      )

      return execute(command, options)
    },
    modules
  }
}
function Mangonel (modules = []) {
  const getLaunchersByName = (modules, name) =>
    modules.filter(m => m.name === name)

  const getFirstLauncher = (...args) =>
    modules.filter(m => m.platforms.filter(p => p === args[1]).length > 0)[0]

  return {
    /**
   *
   *
   * @param {function} emulator launcher modules
   * @param {Object} [launcher={}] launcher object
   * @param {Object} [options={}] options object
   * @returns {int} processId
   */
    launch (software, launcher = {}, settings = {}, options = {}) {
      const command = getFirstLauncher(modules, software.platform).buildCommand(
        software.file,
        launcher,
        settings
      )

      return execute(command, options)
    },
    modules
  }
}
function Mangonel ( modules = [ ] ) { const getLaunchersByName = ( modules , name ) => modules . filter ( m => m . name === name ) const getFirstLauncher = ( ... args ) => modules . filter ( m => m . platforms . filter ( p => p === args [ 1 ] ) . length > 0 ) [ 0 ] return { /**
   *
   *
   * @param {function} emulator launcher modules
   * @param {Object} [launcher={}] launcher object
   * @param {Object} [options={}] options object
   * @returns {int} processId
   */ launch ( software , launcher = { } , settings = { } , options = { } ) { const command = getFirstLauncher ( modules , software . platform ) . buildCommand ( software . file , launcher , settings ) return execute ( command , options ) } , modules } }
mangonel - Main constructor for the application

@param {array} [modules=[]]
mangonel - Main constructor for the application