• This project
    • Loading...
  • Sign in

천현우 / Voicoding

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • Voicoding
  • node_modules
  • node-record-lpcm16
  • recorders
  • index.js
  • 천현우's avatar
    add modules · 83582752
    83582752
    천현우 authored 2021-05-25 17:56:41 +0900
index.js 345 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
const path = require('path')

function load (recorderName) {
  try {
    const recoderPath = path.resolve(__dirname, recorderName)
    return require(recoderPath)
  } catch (err) {
    if (err.code === 'MODULE_NOT_FOUND') {
      throw new Error(`No such recorder found: ${recorderName}`)
    }

    throw err
  }
}

module.exports = {
  load
}