- Windows 10 (x64)
- VS2015
- Python 2.7.11
node@6.11.0
nexe@2.0.0-beta.2
fuse-box@2.2.1
Last active
February 6, 2018 05:06
-
-
Save JamesMGreene/70be6f28fc3fa6875270640c5bc41d82 to your computer and use it in GitHub Desktop.
Trying out nexe@2.x beta native module bundling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { FuseBox } = require('fuse-box') | |
const { NativeModulePlugin } = require('nexe/lib/bundling/fuse') | |
const fuse = FuseBox.init({ | |
homeDir: './', | |
cache: false, | |
log: true, | |
debug: true, | |
output: '$name.js', | |
plugins: [ | |
new NativeModulePlugin({ | |
zmq: { | |
additionalFiles: [ | |
'../../windows/lib/x64/libzmq-v100-mt-4_0_4.dll' | |
] | |
} | |
}) | |
] | |
}) | |
fuse.bundle('app') | |
.target('electron') | |
.instructions(`> index.js`) | |
fuse.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zmq = require('zmq') | |
var pub = zmq.socket('pub') | |
pub.bindSync('tcp://127.0.0.1:3000') | |
console.log('Publisher bound to port 3000') | |
setInterval(function(){ | |
console.log('sending a multipart message envelope') | |
pub.send(['kitty cats', 'meow!']) | |
}, 2500) | |
console.log('global', global.require.main) | |
var sub = zmq.socket('sub') | |
sub.connect('tcp://127.0.0.1:3000') | |
sub.subscribe('kitty cats') | |
console.log('Subscriber connected to port 3000') | |
sub.on('message', function(topic, message) { | |
console.log('received a message related to:', topic.toString(), 'containing message:', message.toString()) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "native-build", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"bundle": "node build.js", | |
"build-windows": "nexe --build -i app.js -o app.exe" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"zmq": "^2.15.3" | |
}, | |
"devDependencies": { | |
"fuse-box": "^2.2.1-beta.7", | |
"nexe": "^2.0.0-beta.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment