diff --git a/README.md b/README.md index c73229d..fa3313a 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Additional files or resources can be added to the binary by passing `-r "glob/pa ## Compiling Node By default `nexe` will attempt to download a pre-built executable. However, It may be unavailable ([github releases](https://github.com/nexe/nexe/releases)) -or you may want to customize what is built. See `nexe --help` for a list of options available when passing the `--build` option. +or you may want to customize what is built. See `nexe --help` for a list of options available when passing the `--build` option. You will also need to ensure your environment is setup to [build node](https://github.com/nodejs/node/blob/master/BUILDING.md) ## Node.js API @@ -106,23 +106,23 @@ compile({ - On Linux this is the path pointing to your python2 executable - On Windows this is the directory where `python` can be accessed - default: `null` - - #### `flags: Array` + - #### `flags: string[]` - Array of node runtime flags to build node with. - Example: `['--expose-gc']` - default: `[]` - - #### `configure: Array` + - #### `configure: string[]` - Array of arguments for the node build configure step - Example: `['--with-dtrace', '--dest-cpu=x64']` - default: `[]` - - #### `make: Array` + - #### `make: string[]` - Array of arguments for the node build make step, on windows this step recieves options for vcBuild.bat - default: `[]` or `['nosign', 'release']` for non windows systems - - #### `make: Array` + - #### `make: string[]` - Alias for `make` option - #### `snapshot: string` - path to a file to be used as the warmup snapshot for the build - default: `null` - - #### `resources: Array` + - #### `resources: string[]` - Array of globs with files to include in the build - Example: `['./public/**/*']` - default: `[]` @@ -141,13 +141,15 @@ compile({ - #### `enableNodeCli: boolean` - Enable the original Node CLI (will prevent application cli from working) - default: `false` + - #### `fakeArgv: boolean` + - fake the entry point file name (`process.argv[1]`). If nexe was used with stdin this will be `'[stdin]'`. - #### `sourceUrl: string` - Provide an alternate url for the node source code - Note: temporary files will still be created for this under the specified version - #### `loglevel: string` - Set the loglevel, info, silent, or verbose - default: `'info'` - - #### `patches: Array` + - #### `patches: NexePatch[]` - Userland patches for patching or modifying node source - default: `[]` @@ -165,7 +167,7 @@ For examples, see the built in patches: [src/patches](src/patches) - Quickly perform a replace in a file within the downloaded Node.js source. The rest arguments are passed along to `String.prototype.replace` - `readFileAsync(filename: string): Promise` - Access (or create) a file within the downloaded Node.js source. - - `files: Array` + - `files: NexeFile[]` - The cache of the currently read, modified, or created files within the downloaded Node.js source. #### `NexeFile` diff --git a/src/options.ts b/src/options.ts index 96ebec2..99a0084 100644 --- a/src/options.ts +++ b/src/options.ts @@ -66,6 +66,7 @@ const alias = { i: 'input', o: 'output', t: 'target', + b: 'build', n: 'name', r: 'resource', a: 'resource', @@ -80,7 +81,7 @@ const alias = { const argv = parseArgv(process.argv, { alias, default: defaults }) const g = c.gray let help = ` -${c.bold('nexe [options]')} +${c.bold('nexe [options]')} ${c.underline.bold('Options:')} diff --git a/test.js b/test.js deleted file mode 100644 index 1e1a484..0000000 --- a/test.js +++ /dev/null @@ -1 +0,0 @@ -console.log(process.version, process.argv) diff --git a/test/target.spec.ts b/test/target.spec.ts index 092f25e..ac82af7 100644 --- a/test/target.spec.ts +++ b/test/target.spec.ts @@ -16,7 +16,7 @@ describe('Targets', () => { ['alpine-notsupported-6.10.3', `alpine-${arch}-6.10.3`], ['not-a-thing', getTarget(process).toString()] ].forEach(([input, expected]) => { - it(`${padRight(JSON.stringify(input), 53)} ${b('->')} ${expected}`, () => { + it(`should accept: ${padRight(JSON.stringify(input), 53)} ${b('->')} ${expected}`, () => { expect(getTarget(input).toString()).to.equal(expected) }) })