From 3ac02efd18539f5fde096a7a0922b6afbbf180d6 Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Thu, 28 Jan 2016 14:50:37 -0800 Subject: [PATCH] readme: document opts for nexe.compile and package.json --- README.md | 27 ++++++++++++++++++--------- bin/nexe | 6 +++--- test/flags-test/package.json | 2 +- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8c0508f..503cf9b 100644 --- a/README.md +++ b/README.md @@ -134,16 +134,23 @@ Options: var nexe = require('nexe'); nexe.compile({ - input: 'input.js', - output: 'path/to/bin', - nodeVersion: '5.5.0', - nodeTempDir: 'src', - python: 'path/to/python', - resourceFiles: [ 'path/to/a/file' ], - flags: true, + input: 'input.js', // where the input file is + output: 'path/to/bin', // where to output the compiled binary + nodeVersion: '5.5.0', // node version + nodeTempDir: 'src', // where to store node source. + nodeConfigureArgs: ['opt', 'val'], // for all your configure arg needs. + nodeMakeArgs: ["-j", "4"], // when you want to control the make process. + python: 'path/to/python', // for non-standard python setups. Or python 3.x forced ones. + resourceFiles: [ 'path/to/a/file' ], // array of files to embed. + flags: true, // use this for applications that need command line flags. + jsFlags: "--use_strict", // v8 flags framework: "node" // node, nodejs, or iojs }, function(err) { - console.log(err); + if(err) { + return console.log(err); + } + + // do whatever }); ``` @@ -153,7 +160,7 @@ nexe.compile({ As of 0.4.0 you can now embed nexe options into package.json. Note that this Format is still in works, so it is likely to change. -``` +```json "nexe": { "input": "./bin/nexe", "output": "nexe^$", @@ -161,6 +168,7 @@ is still in works, so it is likely to change. "runtime": { "framework": "node", "version": "5.5.0", + "js-flags": "--use_strict", "ignoreFlags": true } } @@ -169,6 +177,7 @@ is still in works, so it is likely to change. Notes: * output: can use ^$ for platform specific file extension +* js-flags: this is also known as v8 flags, and supports *all* v8 flags. ## Maintainers diff --git a/bin/nexe b/bin/nexe index 234e66e..946daff 100755 --- a/bin/nexe +++ b/bin/nexe @@ -63,7 +63,7 @@ if(argv.h || argv.help) { **/ function toAbsolute(pt) { if(pt.substr(0, 1) == "/") return pt; - if(pt.substr(1, 3) == ":/") return pt; // for windows "c:/" + if(pt.substr(1, 3) == ":/") return pt; // for windows "c:/" return path.join(process.cwd(), pt); } @@ -71,7 +71,7 @@ if(fs.lstatSync(argv.i).isDirectory()) { opts = nexe.package(path.join(argv.i, "package.json"), argv); nexe.compile(opts, function(error) { if(error) { - console.log(error.message); + return console.log(error.message); } }); } else { @@ -89,7 +89,7 @@ if(fs.lstatSync(argv.i).isDirectory()) { }, function(error) { if(error) { - console.log(error.message); + return console.log(error.message); } } ); diff --git a/test/flags-test/package.json b/test/flags-test/package.json index dcb33d7..0706630 100644 --- a/test/flags-test/package.json +++ b/test/flags-test/package.json @@ -6,7 +6,7 @@ "temp": "src", "runtime": { "framework": "node", - "version": "5.5.0", + "version": "0.12.1", "ignoreFlags": false, "js-flags": "--use_strict", "node-args": ""