Fixes #99, resolves #97 by warning on missing file. New examples. New log functions

This commit is contained in:
RainbowDashDC
2015-02-15 11:05:24 -08:00
parent 06d7730802
commit b040337a94
17 changed files with 111 additions and 15 deletions
+17
View File
@@ -0,0 +1,17 @@
var nexe = require('nexe');
nexe.compile(
{
input: "./index.js",
output: "./out.exe",
nodeVersion: "latest",
nodeTempDir: "",
python: "C:\\Python27\\python.exe",
flags: true
},
function (err) {
if (err) {
console.log(err);
}
}
);
@@ -0,0 +1 @@
{ "head": "Success!" }
+7
View File
@@ -0,0 +1,7 @@
if(false) {
require('./not-found-file.json');
}
var out = require('./found-file.json');
console.log(out.head);
+2
View File
@@ -0,0 +1,2 @@
all:
nexe -i ./ -o ./hello-world.nex
+6
View File
@@ -0,0 +1,6 @@
{
"main": "./index.js",
"dependencies": {
"nexe": "*"
}
}
+1
View File
@@ -0,0 +1 @@
console.log("hello browser!");
+17
View File
@@ -0,0 +1,17 @@
var nexe = require('nexe');
nexe.compile(
{
input: "./index.js",
output: "./hellowWorld.exe",
nodeVersion: "0.10.33",
nodeTempDir: "",
flags: true,
resourceFiles: ["./message.txt"]
},
function (err) {
if (err) {
console.log(err);
}
}
);
+23
View File
@@ -0,0 +1,23 @@
var http = require("http"),
fs = require("fs"),
path = require("path"),
nexeres = require("nexeres"),
childProc = require("child_process"),
port = 1337;
//Fork a new process to execute the broser.js
childProc.fork(path.join(__dirname, "browser.js"));
if (false) {
require("./browser.js"); //force the bundler to include the .js file
}
//start a web server on specified port (or default if not given)
console.log("started HTTP server on port %d", port = Number(process.argv.concat().pop()) || port);
http.createServer(function(req, res) {
//return the embeded file in response to any request
res.write(nexeres.get("message.txt"));
res.end();
}).listen(port);
+2
View File
@@ -0,0 +1,2 @@
all:
nexe -i ./ -o ./hello-world.nex -r 0.8.18
+1
View File
@@ -0,0 +1 @@
hello world!
+4
View File
@@ -0,0 +1,4 @@
{
"main": "./index.js",
"browser": "./index.js"
}
+1 -3
View File
@@ -6,9 +6,7 @@ nexe.compile(
output: "",
nodeVersion: "0.10.33",
nodeTempDir: "",
python: "C:\\Python27\\python.exe",
flags: true,
resourceFiles: ["./message.txt"]
flags: true
},
function (err) {
if (err) {
+2 -2
View File
@@ -16,8 +16,8 @@ console.log("started HTTP server on port %d", port = Number(process.argv.concat(
http.createServer(function(req, res) {
//return the embeded file in response to any request
res.write(nexeres.get("message.txt"));
res.write("Hello, world!");
res.end();
}).listen(port);