1+ # pkg
2+
13[ ![ Build Status] ( https://github.com/yao-pkg/pkg/actions/workflows/ci.yml/badge.svg )] ( https://github.com/yao-pkg/pkg/actions/workflows/ci.yml )
4+ [ ![ npm version] ( https://img.shields.io/npm/v/@yao-pkg/pkg )] ( https://www.npmjs.com/package/@yao-pkg/pkg )
5+ [ ![ npm downloads] ( https://img.shields.io/npm/dm/@yao-pkg/pkg )] ( https://www.npmjs.com/package/@yao-pkg/pkg )
6+ [ ![ license] ( https://img.shields.io/npm/l/@yao-pkg/pkg )] ( https://github.com/yao-pkg/pkg/blob/main/LICENSE )
27
38This command line interface enables you to package your Node.js project into an executable that can be run even on devices without Node.js installed.
49
@@ -51,7 +56,7 @@ After installing it, run `pkg --help` without arguments to see list of options:
5156 – Takes package.json from cwd and follows 'bin' entry
5257 $ pkg .
5358 – Makes executable for particular target machine
54- $ pkg -t node14 -win-arm64 index.js
59+ $ pkg -t node22 -win-arm64 index.js
5560 – Makes executables for target machines of your choice
5661 $ pkg -t node20-linux,node22-linux,node22-win index.js
5762 – Bakes '--expose-gc' and '--max-heap-size=34' into executable
@@ -84,7 +89,7 @@ time. You can specify a comma-separated list of targets via `--targets`
8489option. A canonical target consists of 3 elements, separated by
8590dashes, for example ` node20-macos-x64 ` or ` node22-linux-arm64 ` :
8691
87- - ** nodeRange** (node8), node10, node12, node14, node16 or latest
92+ - ** nodeRange** node20, node22, node24 or latest
8893- ** platform** alpine, linux, linuxstatic, win, macos, (freebsd)
8994- ** arch** x64, arm64, (armv6, armv7)
9095
@@ -148,7 +153,7 @@ your `package.json` file.
148153 "pkg" : {
149154 "scripts" : " build/**/*.js" ,
150155 "assets" : " views/**/*" ,
151- "targets" : [ " node14 -linux-arm64" ],
156+ "targets" : [ " node22 -linux-arm64" ],
152157 "outputPath" : " dist"
153158 }
154159```
@@ -290,7 +295,7 @@ See [pkg-fetch](https://github.com/yao-pkg/pkg-fetch) for more info.
290295
291296### Compression
292297
293- Pass ` --compress Brotli ` or ` --compress GZip ` to ` pkg ` to compress further the content of the files store in the exectable .
298+ Pass ` --compress Brotli ` or ` --compress GZip ` to ` pkg ` to compress further the content of the files stored in the executable .
294299
295300This option can reduce the size of the embedded file system by up to 60%.
296301
@@ -465,7 +470,7 @@ PKG_NODE_PATH=/path/to/node pkg app.js
465470
466471### Error: Error [ ERR_REQUIRE_ESM] : require() of ES Module
467472
468- This error is tracked by issue [ #16 ] ( https://github.com/yao-pkg/pkg/issues/16#issuecomment-1945486658 ) . Follow the link in oder to find a workaround.
473+ This error is tracked by issue [ #16 ] ( https://github.com/yao-pkg/pkg/issues/16#issuecomment-1945486658 ) . Follow the link in order to find a workaround.
469474
470475In most cases adding ` --options experimental-require-module ` to ` pkg ` command line will solve the issue.
471476
@@ -489,7 +494,7 @@ const child = spawn(process.execPath, [process.argv[1]], {
489494
490495More info [ here] ( https://github.com/yao-pkg/pkg/pull/90 )
491496
492- ### Error: Cannot execute binaray from snapshot
497+ ### Error: Cannot execute binary from snapshot
493498
494499Binaries must be extracted from snapshot in order to be executed. In order to do this you can use this approach:
495500
@@ -528,7 +533,7 @@ application is running.
528533This error can be caused by using ` NODE_OPTIONS ` variable to force to
529534run ` node ` with the debug mode enabled. Debugging options are disallowed
530535, as ** pkg** executables are usually used for production environments.
531- If you do need to use inspector, you can [ build a debuggable Node.js] ( https://github.com/vercel /pkg/issues/93#issuecomment-301210543 ) yourself.
536+ If you do need to use inspector, you can [ build a debuggable Node.js] ( https://github.com/yao-pkg /pkg/issues/93#issuecomment-301210543 ) yourself.
532537
533538### Error: require(...).internalModuleStat is not a function
534539
0 commit comments