readme: document opts for nexe.compile and package.json

This commit is contained in:
Jared Allard
2016-01-28 14:50:37 -08:00
parent b100922d91
commit 3ac02efd18
3 changed files with 22 additions and 13 deletions
+18 -9
View File
@@ -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
+3 -3
View File
@@ -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);
}
}
);
+1 -1
View File
@@ -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": ""