Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Created March 14, 2016 19:52
Show Gist options
  • Save mbroadst/f95baec0fbb6bec84806 to your computer and use it in GitHub Desktop.
Save mbroadst/f95baec0fbb6bec84806 to your computer and use it in GitHub Desktop.
breaks nexe packaging - `No such native module`
'use strict';
const fs = require('fs'),
path = require('path');
let modules = [], modulePath = path.join(__dirname, 'modules');
fs.readdir(modulePath, (err, files) => {
files
.filter(fileName => (fileName.indexOf('.') !== 0) && (fileName !== 'index.js'))
.map(fileName => require(path.join(modulePath, fileName))());
});
module.exports = () => console.log('module one loaded');
module.exports = () => console.log('module two loaded'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment