mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 23:57:57 -05:00
20 lines
No EOL
380 B
JavaScript
20 lines
No EOL
380 B
JavaScript
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
function loadPlugins (directory) {
|
|
const plugins = []
|
|
|
|
for (const filename of fs.readdirSync(directory)) {
|
|
if (!filename.endsWith('.js')) continue
|
|
|
|
const filepath = path.join(directory, filename)
|
|
|
|
const plugin = require(filepath)
|
|
|
|
plugins.push(plugin)
|
|
}
|
|
|
|
return plugins
|
|
}
|
|
|
|
module.exports = loadPlugins |