{"versions":{"0.0.1":{"name":"caxa","version":"0.0.1","description":"Package Node.js applications into a single executable binary","main":"lib/index.js","bin":{"caxa":"lib/index.js"},"types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"keywords":["packing","deployment","binary"],"author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"license":"MIT","bugs":{"url":"https://github.com/leafac/caxa/issues"},"homepage":"https://github.com/leafac/caxa#readme","publishConfig":{"access":"public"},"scripts":{"test":"prettier --check \"src/**/*\" --end-of-line auto && jest","build":"tsc","clean":"shx rm -rf lib"},"dependencies":{"commander":"^7.0.0","crypto-random-string":"^3.3.0","dedent":"^0.7.0","shelljs":"^0.8.4"},"devDependencies":{"@types/dedent":"^0.7.0","@types/jest":"^26.0.20","@types/node":"^14.14.26","@types/shelljs":"^0.8.8","jest":"^26.6.3","prettier":"^2.2.1","shx":"^0.3.3","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5"},"jest":{"preset":"ts-jest","testEnvironment":"node"},"gitHead":"0673385f6919696c2f4bfc38010917795b5934a8","_id":"caxa@0.0.1","_nodeVersion":"15.8.0","_npmVersion":"7.5.1","dist":{"integrity":"sha512-A3hb2VS/svUU4zF6qyW1bPOP7FlFl94RcA2IEaGZwVBJnKKRmgdWa8yz66z9PSyPvdxbdayneSgId/rjtMTOpA==","shasum":"2621658ceaa96e64f4e059677c2d1f17d4541cc1","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-0.0.1.tgz","fileCount":19,"unpackedSize":81647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJoxQCRA9TVsSAnZWagAAlDQQAKNJm1fGjpJUAoNEoApq\nhwG9riuGFmXeE6j7VWIKnWoKVgxWpmRJW1oZ3FCIPad8UCPj8DLGL6YY5/Bh\n3Bd23GEItRs5AHMINX4rGQ6btEPiTkMz7iqvEb3viaFiF9UVgvJte2NS5k5R\n0oVWtU4+Pm2gT1fkEQfZCuK5Vs/IsaG+nRfg8zFH7asyoBOaZdI0ddTAhQXe\ngPh36FWiwx5LOk8qqt3wi1AZnwHgjOgYNkhFKbZjHih8swUxB13Hb+b8Tuom\nKb0v1tcPbvJT0jE1u0xaflP4qe5/qYT1I+6JWwUBOi12kTHQL4hnJipOZlCO\nTTfhZ8DR66EexQGF754gK5Gdo+SKX4eAbpXP4m3pPn+d22rg8HG1nsGO3v8V\nxqW3I7J9uw0mxK+CobjZNuif6uw2MI9eB9VKNJTd0eP1c7VydrNCvRNEfzKq\nUfr8S647sbyMpX14hXzXBQzU62X+xDV9NUp5dQ6iPuXh0GEaV5707TTFjDl4\nWJkCPUNsl7+vO0AgFw8cb6skyjHlBmVqdtfcBi9bBA0ryRm6qVVL49K2x3Za\npZSQazX6CHzNcufusHP9sojpAjnBOYWBb96aFhTfEHXHwWSTe+S9gipRcVFY\nn4wsS/CJV+/+jQO7poLerbmKENH/J5MjI3AiGjMca6d7Z/SkZBgi4n7eDHcM\nA+mk\r\n=vis1\r\n-----END PGP SIGNATURE-----\r\n","size":18277},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_0.0.1_1613139024097_0.02707192697952787"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T01:17:26.362Z","deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"0.0.2":{"name":"caxa","version":"0.0.2","description":"Package Node.js applications into executable binaries","main":"lib/index.js","bin":{"caxa":"lib/index.js"},"types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"keywords":["packing","deployment","binary"],"author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"license":"MIT","bugs":{"url":"https://github.com/leafac/caxa/issues"},"homepage":"https://github.com/leafac/caxa#readme","scripts":{"test":"prettier --check \"src/**/*\" --end-of-line auto && jest","prepare":"tsc","stubs":"cd stubs && shx rm -f windows.exe macos linux && cross-env GOOS=windows go build -o windows.exe stub.go && shx echo >> windows.exe && shx echo \"### CAXA ###\" >> windows.exe && cross-env GOOS=darwin go build -o macos stub.go && shx echo >> macos && shx echo \"### CAXA ###\" >> macos && cross-env GOOS=linux go build -o linux stub.go && shx echo >> linux && shx echo \"### CAXA ###\" >> linux"},"dependencies":{"archiver":"^5.2.0","commander":"^7.0.0","crypto-random-string":"^3.3.0","execa":"^4.1.0","fs-extra":"^9.1.0"},"devDependencies":{"@types/archiver":"^5.1.0","@types/fs-extra":"^9.0.7","@types/jest":"^26.0.20","@types/node":"^14.14.26","cross-env":"^7.0.3","jest":"^26.6.3","prettier":"^2.2.1","shx":"^0.3.3","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5"},"jest":{"rootDir":"src","preset":"ts-jest","testEnvironment":"node"},"gitHead":"7d5bb6d08bb09e6e62fabb06913a83ffb0fdc0f3","_id":"caxa@0.0.2","_nodeVersion":"15.11.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-abePcaKp7BjOdqCPGISvr9zCgw9qqDQ6Ac2TOefc/DMzKdTRYo+b4ueG06gZhja/1uQDdgynS0uUWWzxQ4LOSg==","shasum":"fd288d1cc347cedda227ddd680c6a13740a1ca80","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-0.0.2.tgz","fileCount":27,"unpackedSize":10165606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP7P0CRA9TVsSAnZWagAALZMQAI4wT/Gk5hVNMhxAcx6i\ngMmElIvuWf6MR4e1OtGp4p4XlFSHO/kMWbyz7bE6VRbEnLReMi/ERsb0b/ib\nuqctRdfdx5CGJKCEkPNXSyi33Dz3DHg7h4o6NE1U+CaIC7d2lJJUHR21hIMw\ntOX6zENakxxU4JWG/yl1GJec6VUyeC0nizT5abLai32vqcs6Bnz9d15Dslvt\nCGe9u4kO0NeYmFtW+KfHx2C0XC6nfXkO2TyzW7VwL60kr0HKU6nLknuBmk1Z\nDk4HT3XWmHzHDErtKu1rNQ1HxXYRNF1yYTYFuQEAKCeO7KUnj+UNKJQGaJwo\netpgANhZknRtf+iNs1h/dXH8qFzviUgdt5iP1o8FfNi4HsU3hjlH1zvynHWE\nI9aVNMx1cAxE5hLligKprF7TKhxCvS299KnLf2ae5QfwLRX1fbdGjBfpVzEg\nF86dtiKJEJNfNzJanPBzly2d6N302BwatylCGZm3RaGLu0cPBQzQt9j7A1y+\n8C4333zgAHh8EI0D/TXQ8ide1A60KJMtVJ1dHDgqORt0Ji+g7ymTn1TDkg7j\nmHP1ui4oiRdK+ztC4uN0ubMtWouODlEdIzbTQkJLwzAR+jZ9yeCvW7+dB+PH\njxeL+FQqaE7xxLaB1kKfy1NGHIBbPWcStrxwy1bjzCqlG41w7e/SsOxs1Val\npzZy\r\n=9eCd\r\n-----END PGP SIGNATURE-----\r\n","size":5506348},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_0.0.2_1614787570658_0.5698458265190258"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T01:17:31.274Z","deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"1.0.0":{"name":"caxa","version":"1.0.0","description":"Package Node.js applications into executable binaries","main":"lib/index.js","bin":{"caxa":"lib/index.js"},"types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"keywords":["packing","deployment","binary"],"author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"license":"MIT","bugs":{"url":"https://github.com/leafac/caxa/issues"},"homepage":"https://github.com/leafac/caxa#readme","scripts":{"test":"prettier --check \"src/**/*\" --end-of-line auto && jest","prepare":"tsc","stubs":"cd stubs && shx rm -f windows.exe macos linux && cross-env GOOS=windows go build -o windows.exe stub.go && shx echo >> windows.exe && shx echo \"### CAXA ###\" >> windows.exe && cross-env GOOS=darwin go build -o macos stub.go && shx echo >> macos && shx echo \"### CAXA ###\" >> macos && cross-env GOOS=linux go build -o linux stub.go && shx echo >> linux && shx echo \"### CAXA ###\" >> linux"},"dependencies":{"archiver":"^5.2.0","commander":"^7.0.0","crypto-random-string":"^3.3.0","execa":"^4.1.0","fs-extra":"^9.1.0"},"devDependencies":{"@types/archiver":"^5.1.0","@types/fs-extra":"^9.0.7","@types/jest":"^26.0.20","@types/node":"^14.14.26","cross-env":"^7.0.3","jest":"^26.6.3","prettier":"^2.2.1","shx":"^0.3.3","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5"},"jest":{"rootDir":"src","preset":"ts-jest","testEnvironment":"node"},"gitHead":"a904932fe3f78b21c55ccb076743cffa1f09fc73","_id":"caxa@1.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-tZTTXxe8ciw1t5gzOqGMVtSVC6eIXEeAbtO5AZIyNUamSrgrCNoZCf1UE3jU77uKt8OaHigjJOL09NLy3OThKQ==","shasum":"d84e6359afdf75626c66cef1adabcd5860db4c5c","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-1.0.0.tgz","fileCount":27,"unpackedSize":10186057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQGLFCRA9TVsSAnZWagAAxsIP/jxkALzGetB56P/68KfS\nf9Ap0PG16RnrWuKkPQlwG2tmeGtGR41ZOBPZ4D9gzqT3z9Nc4c9cO6PZI54b\niX7jngxSKpREZGVh3IZutRQRsJaayKCgZ7RFgWFUS5pB1LzLuWJQr3x+32PP\nxRIHkegXy32yRmrOB4iCTvSzNnFAtbGbU78qYdldojdP9KxOGBXNojIQXQAj\naQHsHvHtmRT4DjKLNmaE8xb46MlWRxnY4+6b9TYYZ3fUJPYWSKJLobChRB+l\nTo/KIPJyPFPipmlslGJtnJ9Mo7vc4NZBiCqp8HAkOhw9lNh4U2Ibyrk4mxJ9\n7aRpjntTD6fTce9Peuj2CbSiul9oa8jGIExYTvBoPQLEeX5yPlZCU7Qs6xr5\nCXmwQDvRayjNWQrjroK3q56ngTv2FK07EVCEClSKoiiRS3Fl4363DkByt5Gf\nmiCfrdxBbOCt2Ru/caKQlrySEbBKkevXo9hyWmZZ7yN2Lm+j3IdM69u1Yqhr\njUr9Qh5cDxSvmSpLLnRBWz1UqpYCEVOAbKxrQ4PnkcEVtKo9ZTKrgNQnXbXE\nNYfQ/oVk2UfoA7epCa6nTJefkJc2Z2FELxGhvuD+oeZaEk8tQChEw+tf3UBW\njD/fx8dCHacjE4EjcOvS8JG+fHPI7/xK0yGS5II5Nw6wGN+NSoY8B++sC/63\n3nLH\r\n=684z\r\n-----END PGP SIGNATURE-----\r\n","size":5513582},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_1.0.0_1614832324267_0.788543903555454"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T01:17:43.279Z","deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"2.0.0-beta.5":{"name":"caxa","version":"2.0.0-beta.5","description":"Package Node.js applications into executable binaries","main":"lib/index.js","bin":{"caxa":"lib/index.js"},"types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"keywords":["packing","deployment","binary"],"author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"license":"MIT","bugs":{"url":"https://github.com/leafac/caxa/issues"},"homepage":"https://github.com/leafac/caxa#readme","scripts":{"test":"prettier --check \"src/**/*.ts\" --end-of-line auto && jest","prepare":"tsc","build:stub":"shx rm stub && cross-env CGO_ENABLED=0 go build -o stub src/stub.go && shx echo >> stub && shx echo CAXACAXACAXA >> stub","postinstall":"node postinstall.js"},"dependencies":{"archiver":"^5.2.0","commander":"^7.0.0","crypto-random-string":"^3.3.0","download":"^8.0.0","execa":"^4.1.0","fs-extra":"^9.1.0"},"devDependencies":{"@types/archiver":"^5.1.0","@types/fs-extra":"^9.0.7","@types/jest":"^26.0.20","@types/node":"^14.14.26","cross-env":"^7.0.3","jest":"^26.6.3","prettier":"^2.2.1","shx":"^0.3.3","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5"},"jest":{"rootDir":"src","preset":"ts-jest","testEnvironment":"node"},"gitHead":"178a8597e0ad588662e4a94a19eaa9f0e6b7d145","_id":"caxa@2.0.0-beta.5","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-vHnvurq93gyZdMMfvRJNfh/adnNXufAFnAnrX7YB7L8uTnEu3PHncPR0v5ByaPpHTw413Xy3iBkQIU/xzeKT7g==","shasum":"72486608717c21aa78b87165f87b1edd4bb8fc39","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-2.0.0-beta.5.tgz","fileCount":28,"unpackedSize":368813,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgsS+MCRA9TVsSAnZWagAA+rQP/jVUiFOcAOa5h9siyymb\nRa77458LB2S0TKNhDfAFSqag80J9K9G1DcubLFZyPquyBhdVTIyrVfEvaEjE\nqafZcDxzTwuHn75u00o98Gs05sYRQb7e61ISOwUt2UZkl0j7PID1b8V6Rtee\nKS8V3B6ySmuoK1ohpOwlFi/7/u4m0YS98gjdHTvld5C03zg3Mcjf8tLDyUAn\n7sGnOL805lZlcb/7e5JrTQS2qw73/+w9Bj2+tdNKKOUo1WlWGvrIYRK54jPD\n4zOlWxKWCJ7WSQjYGDNEeSiNiGAzdZ0UdK/LB5FdEEfSfw2tz1LtmAybo/lq\n/ZrJ/WMaV9/6WUU9eWsk2hV52DApFSwC/1WAgCg+GmbDswNqmbiiqMkgPUXI\nYhAFSUsiQOrogk+qblWQm/u0wqtc8pbgClt/8m9z9/5rvGujRaiRLhCsyMt1\nUI6xyAN4+A48255jvbDnBMvy6Kim3fwL5pNdFIiRabfZhrYrj/LsXLmUasDP\n4sOQpjSUajaoB4HEokrNR1AIJ4VbCsRwl3Ajk9IVr+zHH5ppqOzJo+g6CHq9\nxol33XxF4Ewr/nM9Ph3AowSXMqdK0qLLfSdiCyQaX1fvEFiC+3xH5ZsxKJEN\nLxYAuAgVygKaWels9yB6cFblln7Ce/8GfGghnE9kK+G39zfnAuH9xEolrp1H\nNIBP\r\n=mNXf\r\n-----END PGP SIGNATURE-----\r\n","size":101619},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_2.0.0-beta.5_1622224780269_0.9995463642257336"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T01:17:44.963Z","hasInstallScript":true,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"2.0.0":{"name":"caxa","version":"2.0.0","description":"Package Node.js applications into executable binaries","main":"lib/index.js","bin":{"caxa":"lib/index.js"},"types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"keywords":["packing","deployment","binary"],"author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"license":"MIT","bugs":{"url":"https://github.com/leafac/caxa/issues"},"homepage":"https://github.com/leafac/caxa#readme","scripts":{"test":"prettier --check \"src/**/*.ts\" --end-of-line auto && jest","prepare":"tsc","build:stub":"shx rm stub && cross-env CGO_ENABLED=0 go build -o stub src/stub.go && shx echo >> stub && shx echo CAXACAXACAXA >> stub","postinstall":"node postinstall.js"},"dependencies":{"archiver":"^5.2.0","commander":"^7.0.0","crypto-random-string":"^3.3.0","download":"^8.0.0","execa":"^4.1.0","fs-extra":"^9.1.0","globby":"^11.0.3"},"devDependencies":{"@types/archiver":"^5.1.0","@types/fs-extra":"^9.0.7","@types/jest":"^26.0.20","@types/node":"^14.14.26","cross-env":"^7.0.3","jest":"^26.6.3","prettier":"^2.2.1","shx":"^0.3.3","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5"},"jest":{"rootDir":"src","preset":"ts-jest","testEnvironment":"node"},"gitHead":"fec692c6fb130d78a6beb590ceb86090caa12c11","_id":"caxa@2.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-r7DPeyNlVxvlvrz7UjwxIbEYlEUy1YbA30OcawLIRND3n/ejcP5utostgxpfSTS1pXkTTCBKC4VaO0J4029UjQ==","shasum":"7e987ad386b621ee0503d12879cc7d60a6fcd0a0","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-2.0.0.tgz","fileCount":28,"unpackedSize":394503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt9taCRA9TVsSAnZWagAAibMP/iiPu/KYXgnO5xeqfK0Z\n2Ml4wCQvfFin62T0j4ClnnDzDFbgFat9N4rNYSd6h0bqsi+/kGrRRH6sKScP\n2DxNCRhQEnDMDjwYIqjxgb/G+hSd3o1VnlwZW5I87diY33kDtMVoLtdiEE1p\nsBujpmx6gKUYgiOtaI3I0oO1PEVRTupeCdTrLvYG53jjmdcqY+Xlv31/phPl\n9tRhMlbS07jOKlLEjOk/SLPUVur+8wtHpwzxMcuFtK5+RNyI0G82xGmLqZ6S\nZmi0su4ATLLLs5wBgKGMHYSA0gDWhaMSwj9aRl+SHWHP4ISrbL4yTx7PRA5a\n6LWHEGDuqK2TBrX3Cbk9UXadz3i1epqjmEX7J9/lMzn4Pzu3hQrHRmp/Lux/\nCrr/7K97AijeM9GaS6vQIbEyxZi2YiMD5hhhEnVQNr7SgBmWC6Ny4naRZuK0\nWYsQEcXTn4+DpEyOAqD7VM1S5KEgrweGefqU79xwQwDehSaQIdSWYFulvdDI\nG6fhjwqjTR+HbrehkXJYvx5CldwWr3NIUwzBGanXKTqWN0l027LkM1M/Zlqb\nr4Oy+8pC0FfGi9iRwajlc1OJ4hMu4fOqjgvwnM0dgqTYMe1PK7pZx5E42n2N\nlAyBf/ga+XHFiBkIPfs7+jw8aGaFNrbiWsQaF/+6O+KS80HmUpgluNvHN5A4\nhXv8\r\n=6mjV\r\n-----END PGP SIGNATURE-----\r\n","size":105442},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_2.0.0_1622661978066_0.9520683798143432"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T01:17:46.560Z","hasInstallScript":true,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"2.1.0":{"name":"caxa","version":"2.1.0","description":"Package Node.js applications into executable binaries","main":"lib/index.js","bin":{"caxa":"lib/index.js"},"types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"keywords":["packing","deployment","binary"],"author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"license":"MIT","bugs":{"url":"https://github.com/leafac/caxa/issues"},"homepage":"https://github.com/leafac/caxa#readme","scripts":{"test":"prettier --check \"src/**/*\" --end-of-line auto && jest","prepare":"tsc","build:stubs":"shx rm -f stubs/stub--win32--x64 && cross-env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o stubs/stub--win32--x64 stubs/stub.go && shx echo >> stubs/stub--win32--x64 && shx echo CAXACAXACAXA >> stubs/stub--win32--x64 && shx rm -f stubs/stub--darwin--x64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o stubs/stub--darwin--x64 stubs/stub.go && shx echo >> stubs/stub--darwin--x64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--x64 && shx rm -f stubs/stub--darwin--arm64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o stubs/stub--darwin--arm64 stubs/stub.go && shx echo >> stubs/stub--darwin--arm64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--arm64 && shx rm -f stubs/stub--linux--x64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o stubs/stub--linux--x64 stubs/stub.go && shx echo >> stubs/stub--linux--x64 && shx echo CAXACAXACAXA >> stubs/stub--linux--x64 && shx rm -f stubs/stub--linux--arm64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o stubs/stub--linux--arm64 stubs/stub.go && shx echo >> stubs/stub--linux--arm64 && shx echo CAXACAXACAXA >> stubs/stub--linux--arm64 && shx rm -f stubs/stub--linux--arm && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o stubs/stub--linux--arm stubs/stub.go && shx echo >> stubs/stub--linux--arm && shx echo CAXACAXACAXA >> stubs/stub--linux--arm"},"dependencies":{"archiver":"^5.2.0","commander":"^7.0.0","crypto-random-string":"^3.3.0","dedent":"^0.7.0","execa":"^4.1.0","fs-extra":"^9.1.0","globby":"^11.0.3"},"devDependencies":{"@types/archiver":"^5.1.0","@types/dedent":"^0.7.0","@types/fs-extra":"^9.0.7","@types/jest":"^26.0.20","@types/node":"^14.14.26","cross-env":"^7.0.3","jest":"^26.6.3","prettier":"^2.2.1","shx":"^0.3.3","ts-jest":"^26.5.1","ts-node":"^9.1.1","typescript":"^4.1.5"},"jest":{"rootDir":"src","preset":"ts-jest","testEnvironment":"node"},"gitHead":"b67c6cdc9807f12203f549ef8a4b3d002119b685","_id":"caxa@2.1.0","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"integrity":"sha512-RMenUUAKteG7neQeIZchqLGWa2QkrlO8KUHeefvDiPURASiKAGHCJUXh8CyLHkDCk5NKIz0IdcRyVXXypB+hXQ==","shasum":"55022f16c2dc4dcf394166fa7053f5d4da8363d4","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-2.1.0.tgz","fileCount":32,"unpackedSize":20072963,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1iHjCRA9TVsSAnZWagAAYxwP/jBmiA+Ycp1qJv55zSm0\nYlNe4gfW+BLQFer5pXmMTQSYaFT/PlCT6GY/1KO7ObIldaJj13FOlYpGcdkK\npBBEjFoffq4TV4Q/kN5ZtOnl2S+3Y+3SCsfGs1vfRHoZfsfVqejbC8F9zT8d\nLvQfVWzhBcV/bw45JQjLV5yYt0GtbhZUAkMDcoKsi7sQC9cPJ4TDaoCz3SAz\n7TxzgDvSZsweZDS9veITzZQgNN7kWEQXk7QCUYHSWQvB0+om4d6exr85H3Uu\n7cyIvFnvEL0VCzdDLqrDLQtcc4ckoD1V1J1+3XzJgVnuZTo31Ys18q+9I45C\nerECObuZSQUn3qsauYS3GZV8JpBuxqBWZOWZiUWdk/5WOnXaTZPnTY9o0O7m\ncQjowQ2bnd/y80iAJ8x/xfGaJDEwHseQwQrEFdCtSe6TKts0AXewIkczmsKF\nY1FS7dN97QtnpjZa2cu8GYaYN3oSC0JH966btReUZkfkFLA3B5fGttCJkjKA\neLzu6GADCDa44EL0gQ0zRjBhheCero561kH+GCPI2aJAbXgnIyUGtgtkTE9Z\nNaJEt76DfJLI3xV8/RzLC4vF8FpKANZFd2JQT+KVYtUlCBuZd0t/b9Bz/YFk\nf2WabGlGvfhNMHhYG0B3qxXJ/wmkdOoTmY4ijvBzI6R6eQmFboDr+nh5OMgj\nTBTh\r\n=m62Q\r\n-----END PGP SIGNATURE-----\r\n","size":10772459},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_2.1.0_1624646114435_0.7327501971817019"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T01:17:54.638Z","deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"3.0.0":{"name":"caxa","version":"3.0.0","description":"Package Node.js applications into executable binaries","author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"homepage":"https://github.com/leafac/caxa","bugs":{"url":"https://github.com/leafac/caxa/issues"},"repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"license":"MIT","keywords":["packing","deployment","binary"],"funding":["https://patreon.com/leafac","https://paypal.me/LeandroFacchinettiEU","https://github.com/sponsors/leafac","https://btc.com/34KJBgtaFYMtDqpSgMayw9qiKWg2GQXA9M"],"exports":"./build/index.mjs","types":"./build/index.d.mts","bin":{"caxa":"build/index.mjs"},"scripts":{"prepare":"cd ./source/ && tsc","prepare:stubs":"shx rm -f stubs/stub--win32--x64 && cross-env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o stubs/stub--win32--x64 stubs/stub.go && shx echo >> stubs/stub--win32--x64 && shx echo CAXACAXACAXA >> stubs/stub--win32--x64 && shx rm -f stubs/stub--darwin--x64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o stubs/stub--darwin--x64 stubs/stub.go && shx echo >> stubs/stub--darwin--x64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--x64 && shx rm -f stubs/stub--darwin--arm64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o stubs/stub--darwin--arm64 stubs/stub.go && shx echo >> stubs/stub--darwin--arm64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--arm64 && shx rm -f stubs/stub--linux--x64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o stubs/stub--linux--x64 stubs/stub.go && shx echo >> stubs/stub--linux--x64 && shx echo CAXACAXACAXA >> stubs/stub--linux--x64 && shx rm -f stubs/stub--linux--arm64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o stubs/stub--linux--arm64 stubs/stub.go && shx echo >> stubs/stub--linux--arm64 && shx echo CAXACAXACAXA >> stubs/stub--linux--arm64 && shx rm -f stubs/stub--linux--arm && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o stubs/stub--linux--arm stubs/stub.go && shx echo >> stubs/stub--linux--arm && shx echo CAXACAXACAXA >> stubs/stub--linux--arm","test":"prettier --check \"source/**/*.mts\" --end-of-line auto && npm run prepare && env TEST=caxa node ./build/index.mjs","test:stubs":"npm run prepare:stubs && npm test"},"dependencies":{"archiver":"^5.3.1","commander":"^9.4.1","crypto-random-string":"^5.0.0","dedent":"^0.7.0","execa":"^6.1.0","fs-extra":"^10.1.0","globby":"^13.1.2"},"devDependencies":{"@types/archiver":"^5.3.1","@types/dedent":"^0.7.0","@types/fs-extra":"^9.0.13","@types/node":"^18.8.5","cross-env":"^7.0.3","prettier":"^2.7.1","shx":"^0.3.4","typescript":"^4.8.4"},"gitHead":"1d82ec0244de5561ca2b74721aa74b730466904a","_id":"caxa@3.0.0","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-4q8Bvd0rVjLMnWZkGzYzOW0elhJEGLH0cVbm91SfbODyGlPNxiHXFb8/Gc9LgrzU/kW6/Gl6jU/R1OrGaA+Amw==","shasum":"1972f830623dbfc803e035ff5769ddc0eda67db8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-3.0.0.tgz","fileCount":28,"unpackedSize":19884160,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/5F8cSee8NbeDi/axGEkWvGabQ5UzNaDcumUdoc9RjAIgHEchRjWREy96/EG9oWhazncATPiNPavw77sKsW89ugs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSgWrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkwxAAlvlsOFEevWve2a2AyCCXXLrOO1nfI0JiDrXRBCXNn8wZrCsv\r\nvREDZBQGqo97EQHhizqKB4c6iinFurOQ4B9iEa+f52K+gg2NoFGl+tf7s10G\r\nlzO39st/GlgpRqLjHFUVDRkXJvo/EZ9Mw9wNrAISCz4fcYF8V3eoZwpihKQM\r\nTi28iqYS8am4B3Jnvmr6nxCNnxPmCfCrA5SUhLrmO94TYTklGCS2vljSAuYk\r\nYgoPmsMd177SapyBgSNIjdalypy/W3AmjHpVD/OH9RBWZQeTexXZfGlNXPED\r\nsm2sfyKDgjRh/PjxO4ulVZRTceyvOdqu8OQz5DItrU7L2L2Ru39sZKOa6Mu2\r\nRiEOURkWEC7snijrrPlp5tahdWCldhAnaOwpxgZMBeEWMJeJKfp6O+CpEjoa\r\n5eo806ySCN+ceyQTm6uluZCjwgpoH2P7OPwaze8DBJvMadXm8+pPZXhAuNk5\r\nJDNdtl/XbzSsXuImZxhOzK0afRLYbQZyBYZNUoRSuiqq4SRk/MgJAeVTZZ+w\r\n9tZM4Qyi8InoEF/VSw0CtDeI8gqBBp0G/NHajRLMHjiC+WpVCH/ycAyx7wVi\r\nL/i4tBSEPeZ57p2ko8cjs1Z/0h18d+paR6Lph0e51sK2M7mDihAUhxfAY5hn\r\n8xGJsodJLfP4RE12kqE55MLTb9EpoxHyCoI=\r\n=PRxt\r\n-----END PGP SIGNATURE-----\r\n","size":10713293},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_3.0.0_1665795498828_0.15251857529298096"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-15T00:58:19.209Z","publish_time":1665795499209,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]},"3.0.1":{"name":"caxa","version":"3.0.1","description":"Package Node.js applications into executable binaries","author":{"name":"Leandro Facchinetti","email":"caxa@leafac.com","url":"https://leafac.com"},"homepage":"https://github.com/leafac/caxa","bugs":{"url":"https://github.com/leafac/caxa/issues"},"repository":{"type":"git","url":"git+https://github.com/leafac/caxa.git"},"license":"MIT","keywords":["packing","deployment","binary"],"funding":["https://patreon.com/leafac","https://paypal.me/LeandroFacchinettiEU","https://github.com/sponsors/leafac","https://btc.com/34KJBgtaFYMtDqpSgMayw9qiKWg2GQXA9M"],"exports":"./build/index.mjs","types":"./build/index.d.mts","bin":{"caxa":"build/index.mjs"},"scripts":{"prepare":"cd ./source/ && tsc","prepare:stubs":"shx rm -f stubs/stub--win32--x64 && cross-env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o stubs/stub--win32--x64 stubs/stub.go && shx echo >> stubs/stub--win32--x64 && shx echo CAXACAXACAXA >> stubs/stub--win32--x64 && shx rm -f stubs/stub--darwin--x64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o stubs/stub--darwin--x64 stubs/stub.go && shx echo >> stubs/stub--darwin--x64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--x64 && shx rm -f stubs/stub--darwin--arm64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o stubs/stub--darwin--arm64 stubs/stub.go && shx echo >> stubs/stub--darwin--arm64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--arm64 && shx rm -f stubs/stub--linux--x64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o stubs/stub--linux--x64 stubs/stub.go && shx echo >> stubs/stub--linux--x64 && shx echo CAXACAXACAXA >> stubs/stub--linux--x64 && shx rm -f stubs/stub--linux--arm64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o stubs/stub--linux--arm64 stubs/stub.go && shx echo >> stubs/stub--linux--arm64 && shx echo CAXACAXACAXA >> stubs/stub--linux--arm64 && shx rm -f stubs/stub--linux--arm && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o stubs/stub--linux--arm stubs/stub.go && shx echo >> stubs/stub--linux--arm && shx echo CAXACAXACAXA >> stubs/stub--linux--arm","test":"prettier --check \"source/**/*.mts\" --end-of-line auto && npm run prepare && env TEST=caxa node ./build/index.mjs","test:stubs":"npm run prepare:stubs && npm test"},"dependencies":{"archiver":"^5.3.1","commander":"^9.4.1","crypto-random-string":"^5.0.0","dedent":"^0.7.0","execa":"^6.1.0","fs-extra":"^10.1.0","globby":"^13.1.2"},"devDependencies":{"@types/archiver":"^5.3.1","@types/dedent":"^0.7.0","@types/fs-extra":"^9.0.13","@types/node":"^18.8.5","cross-env":"^7.0.3","prettier":"^2.7.1","shx":"^0.3.4","typescript":"^4.8.4"},"gitHead":"f63fa946adc0940a4c849958b4b7cbe52784f5b5","_id":"caxa@3.0.1","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-ZVJg1FHU4KCJFCu46L6QI5bu8zxDYe5ExHoiTzW1SypKGpSkAOEVLI/+y6CMKlnwdWhyT+ZOYUBA09HzDgakpA==","shasum":"602bc114ad3a9b8f4eaa988d3de49fdac1eefab8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/caxa/-/caxa-3.0.1.tgz","fileCount":28,"unpackedSize":19884326,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC44KM/hH2P3lKGcPA221rUT531fEKUzeVy6uAG882gIAiB0CNVB7uFO4TeLYe/6FmzLfk4rD8XYR40YkWE54pWDOA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjShaRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobkhAAoGVmuUT+WWGVSwvqp9dEzA4piAe0Jg3wQb+f/4ulJc6HRGhm\r\nn26IWzcP5TJZiqHYbYanoXBIhcl/ArdC5nJ1USdwV4O4Wzi91s/V0O93mvai\r\nockytyfndPX/ZsrUVAMeK2sP6G4Z1+hGesygqUwc5qExvHcQohyscJPGM37f\r\n3iMIkmapqPRxaMdcn52+xdz585w7tSa5aeWcXMRLsVUv6taINbWCHAqcVbk7\r\nKVRg7J6lLk7RkY1Jj1cbkvOJVppNGmtpkhIzApjbux49dqSHo3V33yaRrmZp\r\n2g6iCVbicGTrJEqe8KQP/S7SLsflnqSOEliHDEq+dpI4SshY3RiwPYCShSGJ\r\nR3FS2olfgk+gUr+VgSn1rspuJl3IJAJULXLpgK+SfNvfQTuVLaZrLWFAWmvw\r\n2W8fd5eO77AFXJYxTdxaq1IWPNolhCeSlaawD4n17cV3/5og14AAog/uDAkU\r\nfaCrSJ5BKH12s4I3i10xwUhG6VDqZXMTKtx7BsrhVIGws7ioMbPivtz+w+tM\r\nHK8N4TYck2QVukKMprnjpwLdk5ZKRxOnBUCnYj7Yu2OAbcLqFX9/4AWjBYRw\r\nlASRp2ZyHtTxDkp0qDc59CYlTAP582KF22tGEpvO496DgWoltFV2xO5xbUIT\r\n2Ku+uTspxNQNd9vLconfepubad6B8+mdeiU=\r\n=srzK\r\n-----END PGP SIGNATURE-----\r\n","size":10713376},"_npmUser":{"name":"anonymous","email":"npm@leafac.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"npm@leafac.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/caxa_3.0.1_1665799824902_0.5174634568570673"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-15T02:10:25.292Z","publish_time":1665799825292,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]}},"dist-tags":{"latest":"3.0.1"},"name":"caxa","time":{"created":"2022-01-28T00:42:31.662Z","modified":"2025-03-13T02:50:27.239Z","0.0.1":"2021-02-12T14:10:24.314Z","0.0.2":"2021-03-03T16:06:11.757Z","1.0.0":"2021-03-04T04:32:04.795Z","2.0.0-beta.5":"2021-05-28T17:59:40.465Z","2.0.0":"2021-06-02T19:26:18.541Z","2.1.0":"2021-06-25T18:35:14.842Z","3.0.0":"2022-10-15T00:58:19.209Z","3.0.1":"2022-10-15T02:10:25.292Z"},"readme":"<!--\n\nDocument JavaScript API\n\nTODO: Use `exec` on Go stub on macOS & Linux.\n\n- [ ] Security concern: Only let the user who extracted the binary read it\n- [ ] Automatic updates\n- [ ] Ask for mention in README:\n    - [ ] https://github.com/nexe/nexe\n    - [ ] https://github.com/mongodb-js/boxednode\n    - [ ] https://github.com/pmq20/node-packer\n    - [ ] https://github.com/criblio/js2bin\n    - [ ] https://github.com/h2non/nar\n- [ ] Compile caxa with caxa (it becomes a tool for creating general self-extracting archives)\n- [ ] What does ncc do with native modules?\n- [ ] AppImage on linux?\n\nMention that ESM works (or anything you can throw at a command-line `node` invocation)\n\n\nOh, interesting. It seems like you and I understand the point of `--exclude` differently:\n\n**You:** `--exclude` means “don’t include this file in the binary.”\n**I:** `--exclude` means “don’t copy this file over into the temporary directory where the application will be prepared.”\n\nYour `--exclude` comes late in the chain of processes that need to happen to make an executable. Mine comes early.\n\nThat’s a miscommunication that I’ll address in the documentation.\n\n-->\n\n<h1 align=\"center\">caxa</h1>\n<h3 align=\"center\">📦 Package Node.js applications into executable binaries 📦</h3>\n<p align=\"center\">\n<a href=\"https://github.com/leafac/caxa\"><img src=\"https://img.shields.io/badge/Source---\" alt=\"Source\"></a>\n<a href=\"https://www.npmjs.com/package/caxa\"><img alt=\"Package\" src=\"https://badge.fury.io/js/caxa.svg\"></a>\n<a href=\"https://github.com/leafac/caxa/actions\"><img src=\"https://github.com/leafac/caxa/workflows/.github/workflows/main.yml/badge.svg\" alt=\"Continuous Integration\"></a>\n</p>\n\n# [Watch the Video Demonstration](https://youtu.be/JRwxx2jc2zU)\n\n### Support\n\n- Recurring support on Patreon: <https://patreon.com/leafac>\n- One-time support on PayPal: <https://paypal.me/LeandroFacchinetti>\n\n### Why Package Node.js Applications into Executable Binaries?\n\n- Simple deploys. Transfer the binary into a machine and run it.\n- Let users test an application even if they don’t have Node.js installed.\n- Simple installation story for command-line applications.\n- It’s like the much-praised distribution story of [Go](https://golang.org) programs, but for Node.js.\n\n### Features\n\n- Works on Windows, macOS (Intel & ARM), and Linux (Intel, ARM6, ARM7, ARM64).\n- Simple to use. `npm install caxa` and call `caxa` from the command line. No need to declare which files to include; no need to bundle the application into a single file.\n- Supports any kind of Node.js project, including those with native modules (for example, [sharp](https://npm.im/sharp), [@leafac/sqlite](https://npm.im/@leafac/sqlite) (shameless plug!), [and others](https://www.npmjs.com/package/windows-build-tools#examples-of-modules-supported)).\n- Works with any Node.js version.\n- Packages in seconds.\n- Relatively small binaries. A “Hello World!” application is ~30MB, which is terrible if compared to Go’s ~2MB, and worse still if compared to C’s ~50KB, but best-in-class if compared to other packaging solutions for Node.js.\n- Produces `.exe`s for Windows, simple binaries for macOS/Linux, and macOS Application Bundles (`.app`).\n- Based on a simple but powerful idea. Implemented in ~200 lines of code.\n- No magic. No traversal of `require()`s trying to find which files to include; no patches to Node.js source.\n\n### Anti-Features\n\n- Doesn’t patch the Node.js source code.\n- Doesn’t build Node.js from source.\n- Doesn’t support cross-compilation (for example, building a Windows executable from a macOS development machine).\n- Doesn’t support packaging with a Node.js version different from the one that’s running caxa (for example, bundling Node.js 15 while running caxa with Node.js 14).\n- Doesn’t hide your JavaScript source code in any way.\n\n### Installation\n\n```console\n$ npm install --save-dev caxa\n```\n\n### Usage\n\n#### Prepare the Project for Packaging\n\n- Install any dependencies with `npm install` or `npm ci`.\n- Build. For example, compile TypeScript with `tsc`, bundle with webpack, and whatever else you need to get the project ready to start. Typically this is the kind of thing that goes into an [npm `prepare` script](https://docs.npmjs.com/cli/v7/using-npm/scripts#prepare-and-prepublish), so the `npm ci` from the previous point may already have taken care of this.\n- If there are files that shouldn’t be in the package, remove them from the directory. For example, you may wish to remove the `.git` directory.\n- You don’t need to `npm dedupe --production`, because caxa will do that for you from within the build directory. (Otherwise, if you tried to `npm dedupe --production` you’d uninstall caxa, which should probably be in `devDependencies`.)\n- It’s recommended that you run caxa on a Continuous Integration server. (GitHub Actions, for example, does a shallow fetch of the repository, so removing the `.git` directory becomes negligible—but you can always do that with the `--exclude` advanced option.)\n\n#### Call caxa from the Command Line\n\n```console\n$ npx caxa --help\nUsage: caxa [options] <command...>\n\nPackage Node.js applications into executable binaries\n\nArguments:\n  command                                The command to run and optional arguments to pass to the command every time the executable is called. Paths must be absolute. The ‘{{caxa}}’ placeholder is substituted for the folder from which the package runs. The ‘node’ executable is available at ‘{{caxa}}/node_modules/.bin/node’. Use double quotes to delimit the command and each argument.\n\nOptions:\n  -i, --input <input>                    [Required] The input directory to package.\n  -o, --output <output>                  [Required] The path where the executable will be produced. On Windows, must end in ‘.exe’. In macOS and Linux, may have no extension to produce regular binary. In macOS and Linux, may end in ‘.sh’ to use the Shell Stub, which is a bit smaller, but depends on some tools being installed on the end-user machine, for example, ‘tar’, ‘tail’, and so forth. In macOS, may end in ‘.app’ to generate a macOS Application Bundle.\n  -F, --no-force                         [Advanced] Don’t overwrite output if it exists.\n  -e, --exclude <path...>                [Advanced] Paths to exclude from the build. The paths are passed to https://github.com/sindresorhus/globby and paths that match will be excluded. [Super-Advanced, Please don’t use] If you wish to emulate ‘--include’, you may use ‘--exclude \"*\" \".*\" \"!path-to-include\" ...’. The problem with ‘--include’ is that if you change your project structure but forget to change the caxa invocation, then things will subtly fail only in the packaged version.\n  -D, --no-dedupe                        [Advanced] Don’t run ‘npm dedupe --production’ on the build directory.\n  -p, --prepare-command <command>        [Advanced] Command to run on the build directory after ‘npm dedupe --production’, before packaging.\n  -N, --no-include-node                  [Advanced] Don’t copy the Node.js executable to ‘{{caxa}}/node_modules/.bin/node’.\n  -s, --stub <path>                      [Advanced] Path to the stub.\n  --identifier <identifier>              [Advanced] Build identifier, which is part of the path in which the application will be unpacked.\n  -B, --no-remove-build-directory        [Advanced] Remove the build directory after the build.\n  -m, --uncompression-message <message>  [Advanced] A message to show when uncompressing, for example, ‘This may take a while to run the first time, please wait...’.\n  -V, --version                          output the version number\n  -h, --help                             display help for command\n\nExamples:\n  Windows:\n  > caxa --input \"examples/echo-command-line-parameters\" --output \"echo-command-line-parameters.exe\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.mjs\" \"some\" \"embedded arguments\" \"--an-option-thats-part-of-the-command\"\n\n  macOS/Linux:\n  $ caxa --input \"examples/echo-command-line-parameters\" --output \"echo-command-line-parameters\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.mjs\" \"some\" \"embedded arguments\" \"--an-option-thats-part-of-the-command\"\n\n  macOS/Linux (Shell Stub):\n  $ caxa --input \"examples/echo-command-line-parameters\" --output \"echo-command-line-parameters.sh\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.mjs\" \"some\" \"embedded arguments\" \"--an-option-thats-part-of-the-command\"\n\n  macOS (Application Bundle):\n  $ caxa --input \"examples/echo-command-line-parameters\" --output \"Echo Command Line Parameters.app\" -- \"{{caxa}}/node_modules/.bin/node\" \"{{caxa}}/index.mjs\" \"some\" \"embedded arguments\" \"--an-option-thats-part-of-the-command\"\n```\n\nHere’s [a real-world example of using caxa](https://github.com/courselore/courselore/blob/c0b541d63fc656986ebeab4af3f3dc9bc2909972/.github/workflows/main.yml). This example includes packaging for Windows, macOS, and Linux; distributing tags with GitHub Releases Assets; distributing Insiders Builds for every push with GitHub Actions Artifacts; and deploying a binary to a server with `rsync` (and publishing an npm package as well, but that’s beyond the scope of caxa).\n\n#### Call caxa from TypeScript/JavaScript\n\nInstead of calling caxa from the command line, you may prefer to write a program that builds your application, for example:\n\n```typescript\nimport caxa from \"caxa\";\n\n(async () => {\n  await caxa({\n    input: \"examples/echo-command-line-parameters\",\n    output: \"echo-command-line-parameters\",\n    command: [\n      \"{{caxa}}/node_modules/.bin/node\",\n      \"{{caxa}}/index.mjs\",\n      \"some\",\n      \"embedded arguments\",\n    ],\n  });\n})();\n```\n\nYou may need to inspect `process.platform` to determine in which operating system you’re running and come up with the appropriate parameters.\n\n### Fine Points\n\n#### Calling an Executable That Isn’t `node`\n\nIf you wish to run a command that isn’t `node`, for example, `ts-node`, you may do so by extending the `PATH`. For example, you may run the following on macOS/Linux:\n\n```console\n$ caxa --input <input> --output <output> -- \"env\" \"PATH={{caxa}}/node_modules/.bin/:\\$PATH\" \"ts-node\" \"{{caxa}}/index.ts\"\n```\n\n#### Preserving the Executable Mode of the Binary\n\nThis is only an issue on macOS/Linux. In these operating systems a binary must have the executable mode enabled in order to run. You may check the mode from the command line with `ls -l`: on an output that reads like `-rwxr-xr-x [...]/bin/node`, the `x`s represent that the file is executable.\n\nHere’s what you may do when you distribute the binary to ensure that the file mode is preserved:\n\n1. Create a tarball or zip. The file mode is preserved through compression/decompression, and macOS/Linux (most distributions, anyway) come out of the box with software to uncompress tarballs and zips—the user can just double-click on the file.\n\n   You may generate a tarball with, for example, the following command:\n\n   ```console\n   $ tar -czf <caxa-output>.tgz <caxa-output>\n   ```\n\n   **Fun fact:** Windows 10 also comes with the `tar` executable, so the command above works on Windows as well. Unfortunately the File Explorer on Windows doesn’t support uncompressing the `.tgz` with a double-click (it supports uncompressing `.zip`, however). Fortunately, Windows doesn’t have issues with file modes to begin with (it simply looks for the `.exe` extension) so distributing the caxa output directly is appropriate.\n\n2. Fix the file mode after downloading. Tell your users to run the following command:\n\n   ```console\n   $ chmod +x <path-to-downloaded-application>\n   ```\n\n   In some contexts this may make more sense, but it requires your users to use the command line.\n\n#### Detect Whether the Application Is Running from the Packaged Version\n\ncaxa doesn’t do anything special to your application, so there’s no built-in way of telling whether the application is running from the packaged version. It’s part of caxa’s ethos of being as out of the way as possible. Also, I consider it to be a bad practice: an application that is so self-aware is more difficult to reason about and test.\n\nThat said, if you really need to know whether the application is running from the packaged versions, here are some possible workarounds in increasing levels of badness:\n\n1. Set an environment variable in the command, for example, `\"env\" \"CAXA=true\" \"{{caxa}}/node_modules/.bin/node\" \"...\"`.\n2. Have a different entrypoint for the packaged application, for example, `\"{{caxa}}/node_modules/.bin/node\" \"caxa-entrypoint.js\"`.\n3. Receive a command-line argument that you embed in the packaging process, for example, `\"{{caxa}}/node_modules/.bin/node\" \"application.js\" \"--caxa\"`.\n4. Check whether `__dirname.startsWith(path.join(os.tmpdir(), \"caxa\"))`.\n\n#### The Current Working Directory\n\nEven though the code for the application is in a temporary directory, the current working directory when calling the packaged application is preserved, and you may inspect it with `process.cwd()`. This is probably not something you have to think about—caxa just gets it right.\n\n### How It Works\n\n#### The Issue\n\nAs far as I can understand, the root of the problem with creating binaries for Node.js projects is native modules. Native modules are libraries written at least partly in C/C++, for example, [sharp](https://npm.im/sharp), [@leafac/sqlite](https://npm.im/@leafac/sqlite) (shameless plug!), [and others](https://www.npmjs.com/package/windows-build-tools#examples-of-modules-supported). There are at least three issues with native modules that are relevant here:\n\n1. You must have a working C/C++ build system to install these libraries (C/C++ compiler, `make`, Python, and so forth). On Windows, you must install [windows-build-tools](https://npm.im/windows-build-tools). On macOS, you must install the Command-Line Tools (CLT) with `xcode-select --install`. On Linux, it depends on the distribution, but on Ubuntu `sudo apt install build-essential` is enough.\n\n2. The installation of native modules isn’t cross-platform. Unlike JavaScript dependencies, which you may copy from an operating system to another, native modules produce compiled C/C++ code that’s specific to the operating system on which the dependency is installed. This compiled code appears in your `node_modules` directory in the form of `.node` files.\n\n3. As far as I understand, **Node.js insists on loading native modules from files in the disk**. Other Node.js packaging solutions get around this limitation in one of two ways: They either patch Node.js to trick it into loading native modules differently; or they put `.node` files somewhere before starting your program.\n\n#### The Solution\n\ncaxa builds on the idea of putting `.node` files in a temporary location, but takes it to ultimate consequence: a caxa executable is a form of [self-extracting archive](https://en.wikipedia.org/wiki/Self-extracting_archive) containing your whole project along with the `node` executable. When you first run a binary produced by caxa, it **extracts the source the whole project (and the bundled `node` executable) into a temporary location**. From there, it simply calls whatever command you told it to run when you packaged the project.\n\nAt first, this may seem too costly, but in practice it’s mostly okay: It doesn’t take too long to uncompress a project in the first place, and caxa doesn’t clean the temporary directory after running your program, so subsequent calls are effectively cached and run without overhead.\n\nThis idea is simple, but it’s super powerful! caxa supports any kind of project, including those with native dependencies, because running a caxa executable amounts to the same as installing Node.js on the user’s machine. caxa produces packages fast, because generating a self-extracting archive is a simple matter of concatenating some files. caxa supports any version of Node.js, because it simply copies the `node` executable with which it was called into the self-extracting archive.\n\n**Fun fact:** By virtue of compressing the archive, caxa produces binaries that are naturally smaller when compared to other packaging solutions. Obviously, you could achieve the same outcome by compressing the output of these other tools, which may want to do anyway to preserve the file mode (see [§ Preserving the Executable Mode of the Binary](#preserving-the-executable-mode-of-the-binary)).\n\n#### How the Self-Extracting Archive Works\n\nDid you know that you may append anything to a binary and it’ll continue to work? This is true of binaries for Windows, macOS, and Linux. Here’s an example to try out on macOS/Linux:\n\n```console\n$ cp $(which ls) ./ls  # Copy the ‘ls’ binary into the current directory to play with it\n$ ./ls                 # List the files, proving the that the binary works\n$ echo ANYTHING >> ls  # Append material to the binary\n$ tail ./ls            # You should see ‘ANYTHING’ at the end of the output\n$ ./ls                 # The output should be same as before!\n$ rm ls                # Okay, the test is over\n```\n\nThe caxa self-extracting archives work by putting together three parts: 1. a stub; 2. an archive; and 3. a footer. This is the layout of these parts in the binary produced by caxa:\n\n```\nSTUB\nCAXACAXACAXA\nARCHIVE\nFOOTER\n```\n\nThe `STUB` and the `ARCHIVE` are separated by the `CAXACAXACAXA` string. And the `ARCHIVE` and the `FOOTER` are separated by a newline. This layout allows caxa to find the footer by simply looking backward from the end of the file until it reaches a newline. And if this is the first time you’re running the caxa executable and the archive needs to be uncompressed, then caxa may find the beginning of the `ARCHIVE` by looking forward from the beginning until it reaches the `CAXACAXACAXA` separator.\n\nBuild a binary with caxa and inspect it yourself in a text editor (Visual Studio Code asks you to confirm that you want to open a binary, but works fine after that). You should be able to find the `CAXACAXACAXA` separator between the `STUB` and the `ARCHIVE`, as well as the `FOOTER` at the end.\n\nLet’s examine each of the parts in detail:\n\n**Part 1: Stub**\n\nThis is a program written in Go that:\n\n1. Reads itself as a file.\n2. Finds the footer.\n3. Determines whether it’s necessary to extract the archive.\n   1. If so, finds the archive.\n   2. Extracts it.\n4. Runs whatever command it’s told in the footer.\n\nYou may find the source code for the stub in `stubs/stub.go`. You may build the stub with `npm run prepare:stubs`. You will need a Go compiler, but the stub has no dependencies beyond the Go standard library, so there’s no need to setup Go modules or configure a `$GOPATH`. There are pre-compiled stubs for the major platforms in the npm package. If you wish to verify that the stubs really were compiled from `stubs/stub.go`, you may recompile it yourself, because the Go compiler appears to be deterministic and always produce the same binaries given the same source (at least that’s what happened in my tests).\n\nThis is beautiful in a way: We’re using Go’s ability to produce binaries to bootstrap Node.js’s ability to produce binaries.\n\n**Part 2: Archive**\n\nThis is a tarball of the directory with your project.\n\n**Part 3: Footer**\n\nThis is JSON containing the extra information that caxa needs to run your project: Most importantly, the command that you want to run, but also an identifier for where to uncompress the archive.\n\n#### Using the Self-Extracting Archive without caxa\n\n**Fun fact:** There’s nothing Node.js-specific about the stubs. You may use them to uncompress any kind of archive and run any arbitrary command on the output! And it’s relatively straightforward to build a self-extracting archive from scratch. For example, you may run the following in macOS:\n\n```console\n$ cp stub an-ls-caxa\n$ tar -czf - README.md >> an-ls-caxa\n$ printf \"\\n{ \\\"identifier\\\": \\\"an-ls-caxa/AN-ARBITRARY-STRING-THAT-SHOULD-BE-DIFFERENT-EVERY-TIME\\\", \\\"command\\\": [\\\"ls\\\", \\\"{{caxa}}\\\"] }\" >> an-ls-caxa\n$ ./an-ls-caxa\nREADME.md\n```\n\n#### To Where Are the Packages Uncompressed at Runtime?\n\nIt depends on the operating system. You may find the location on your system with:\n\n```console\n$ node -p \"require(\\\"os\\\").tmpdir()\"\n```\n\nLook for a directory named `caxa` in there.\n\n#### Why No Cross-Compilation? Why No Different Versions of Node.js besides the Version with Which caxa Was Called?\n\nTwo reasons:\n\n1. I believe you should have environments to work with all the operating systems you plan on supporting. They may not be your main development environment, but they should be able to build your project and let you test things. At the very least, you should use a service like GitHub Actions which lets you run build tasks and tests on Windows, macOS, and Linux.\n\n   (I, for one, bought a PC to work on caxa. Yet another reason to [support my work](#support)!)\n\n2. The principle of least surprise. When cross-compiling (for example, building a Windows executable from a macOS development machine), or when bundling different versions of Node.js (for example, bundling Node.js 15 while running caxa with Node.js 14), there’s no straightforward way to guarantee that the packaged project will run the same as the unpackaged version. If you aren’t using any native modules then things **may** work, but as soon as you introduce a new dependency that you didn’t know was native your application may break. Not only are native dependencies different on the operating systems, but they may also be different between different versions of Node.js if these versions aren’t ABI-compatible (which is why sometimes when you update Node.js you must run `npm install` again).\n\n**Fun fact:** The gold-standard for easy cross-compilation these days is Go. But even in Go cross-compilation goes out the window as soon as you introduce C dependencies (something called CGO). It appears that many people in the Go community try to solve the issue by avoiding CGO dependencies, sometimes going to great lengths to reinvent everything in pure Go. On the one hand, this sounds like fun when it works out. On the other hand, it’s a huge case of not-invented-here syndrome. In any case, native modules seem to be much more prevalent in Node.js than CGO is in Go, so I think that cross-compilation in caxa would be a fool’s errand.\n\nIf you still insist on cross-compiling or compiling for different versions of Node.js, you can still use the stub to build a self-extracting archive by hand (see [§ Using the Self-Extracting Archive without caxa](#using-the-self-extracting-archive-without-caxa)). You may even use <https://www.npmjs.com/package/node> to more easily bundle different versions of Node.js.\n\n#### How the macOS Application Bundles (`.app`) Work\n\nAn macOS Application Bundle is just a folder with a particular structure and an executable at a particular place. When creating a macOS Application Bundle caxa doesn’t build a self-extracting archive, instead it just copies the application to the right place and creates an executable bash script to start the process.\n\nThe macOS Application Bundle may be run by simply double-clicking on it from Finder. It opens a Terminal.app window with your application. If you’re running an application that wasn’t built on your machine (which is most likely the case for your users, who probably downloaded the application from the internet), then the first time you run it macOS will probably complain about the lack of a signature. The solution is to go to **System Preferences > Security & Privacy > General** and click on **Allow**. You must instruct your users on how to do this.\n\n#### How the Shell Stub (`.sh`) Works\n\nIt’s equivalent to the Go stub, except that it is smaller, because it’s just a dozen lines of Bash, but it depends on some things being installed on the end-user machine, for example, `tar`, `tail`, and so forth.\n\n### Features to Consider Implementing in the Future\n\nIf you’re interested in one of these features, please send a Pull Request if you can, or at least reach out to me and mention your interest, and I may get to them.\n\n1. Other compression algorithms. Currently caxa uses tarballs, which are ubiquitous and reasonably efficient in terms of compression/uncompression times and archive size. But there are better algorithms out there… (See <https://github.com/leafac/caxa/issues/1>.)\n\n2. Add support for signing the executables. There are limitations on the kinds of executables that are signable, and a self-extracting archive of the kind that caxa produces may be unsignable (I know very little about this…). A solution could be use Go’s support for embedding data in the binary (which landed in Go 1.16). Of course this would require the person packaging a project to have a working Go build system. Another solution would be to manipulate the executables as data structures, instead of just appending stuff at the end. Go has facilities for this in the standard library, but then the packager itself (not only the stubs) would have to be written in Go, and creating packages on the command line by simply concatenating files would be impossible.\n\n3. Add support for custom icons and other package metadata. This should be relatively straightforward by using [rcedit](https://github.com/electron/rcedit) for `.exe`s and by adding `.plist` files to `.app`s (we may copy whatever Electron is doing here as well).\n\n### Prior Art\n\nHere’s my preliminary research: <https://github.com/vercel/pkg/pull/837#issuecomment-782522154>\n\nBelow follows the extended version with everything I learned along the way of building caxa.\n\n#### [Deno](https://deno.land/manual@v1.8.0/tools/compiler)\n\nDeno has experimental support for producing binaries. I haven’t tried it myself, but maybe one day it catches on and caxa becomes obsolete. Let’s hope for that!\n\n#### <https://github.com/vercel/pkg>\n\npkg is great, and it’s where I first learned that you could think about compiling Node.js projects this way. It’s [the most popular packaging solution for Node.js by a long shot](https://www.npmtrends.com/pkg-vs-boxednode-vs-js2bin-vs-nexe-vs-enclose-vs-nar).\n\nIt works by patching the Node.js executable with a proxy around [`fs`](https://github.com/vercel/pkg/blob/7a9257ac91efaddc90c558173af1a6bec5da6cdd/prelude/bootstrap.js#L378). This proxy adds the ability to look into something called a **snapshot** file system, which is where your project is stored. Also, it doesn’t store your source JavaScript directly. It runs your JavaScript through the V8 compiler and produces a V8 snapshot, which has two nice consequences: 1. Your code will start marginally faster, because all the work of parsing the JavaScript source and so forth is already done; and 2. Your code doesn’t live in the clear in the binary, which may be advantageous if you want to hide it.\n\nUnfortunately, this approach has a few issues:\n\n1. The Node.js patches must be kept up-to-date. For example, when `fs/promises` became a thing, the `fs` proxy didn’t support it. It was a subtle and surprising issue that only arises in the packaged version of the application. (For the fix, see my fork of pkg, [@leafac/pkg](https://github.com/leafac/pkg) (which has been deprecated now that caxa has been released).)\n\n2. The patched Node.js distributions must be updated with each new Node.js release. At the time of this writing they’re [lagging behind by half an year](https://github.com/vercel/pkg-fetch/releases) (v14.4.0, while the latest LTS is v14.16.0). That’s new features and security updates you may not be getting. (See https://github.com/yao-pkg/pkg-binaries for a seemingly abandoned attempt at automating the patching process that could improve on this situation. Of course, manual intervention would still be required every time the patches become incompatible with Node.js upstream.)\n\n3. Native modules work [by the way of a self-extracting archive](https://github.com/vercel/pkg/tree/7a9257ac91efaddc90c558173af1a6bec5da6cdd#native-addons).\n\nAlso, pkg traverses the source code for your application and its dependencies looking for things like `require()`s to prune code that isn’t used. This is good if you want to optimize for small binaries with little effort. But often this process goes wrong, specially when something like TypeScript produces JavaScript that throws off pkg’s heuristics. In that case you have to intervene and list the files that should be included by hand.\n\nNot to mention that the maintainers of pkg haven’t been super responsive this past year. (And who can blame them? Open-source is **hard**. No shade thrown here; pkg is **awesome**! And speaking of “open-source is hard,” [support my work](#support)!)\n\n#### <https://github.com/nexe/nexe>\n\nThe second most popular packaging solution in Node.js. nexe works by a similar strategy, and suffers from some of the same issues. But `fs/promises` work, [newer Node.js versions are available](https://github.com/nexe/nexe/releases/tag/v3.3.3), and the project seems to be maintained more actively.\n\nNative modules don’t work, but there’s a workaround based on the idea of self-extracting archives: https://github.com/nmarus/nexe-natives\n\n#### <https://github.com/mongodb-js/boxednode>\n\nThis works with a different strategy. Node.js has a part of the standard library written in JavaScript itself, and when Node.js is built, this JavaScript ends up embedded as part of the `node` executable. boxednode works by recompiling Node.js from source with your project embedded as if it were part of the standard library. On the upside, this supports native extensions and whatever new `fs/promises` situation comes up in the future. The down side is that compiling Node.js takes hours (the first time, and still a couple minutes after the subsequent times) and 10+GB of disk(!) Also, boxednode only works with a single JavaScript file, so you must bundle with something like ncc or webpack before packaging. And I don’t think it handles assets like images along with the code, which would be essential when packaging a web application.\n\n#### <https://github.com/pmq20/node-packer>\n\nThis works with an idea of a **snapshot** file system (à la pkg), but it follows a more principled approach for that, using something called Squashfs. To the best of my knowledge the native-extensions story in node-packer is the same self-extracting archive from most packaging solutions. The downside of node-packer is that installing and setting it up is a bit more involved than a simple `npm install`. For that reason I ended up not really giving it a try, so I’ll say no further…\n\n#### <https://github.com/criblio/js2bin>\n\nThis should work with a strategy similar to boxednode, but with a pre-compiled binary including some pre-allocated space to save you from having to compile Node.js from source. Like boxednode, it should handle only a single JavaScript file, requiring a bundler like ncc or webpack. I tried js2bin and it produced binaries that didn’t work at all. I have no idea why…\n\n#### <http://enclosejs.com>\n\nThe predecessor of pkg. Worked with the same idea. I believe it has been deprecated in favor of pkg. To the best of my knowledge it was closed source and paid.\n\n#### <https://github.com/h2non/nar>\n\nThis is the project that gave me the idea for caxa! It’s more obscure, so at first I payed it little attention in my investigation. But then it handled native extensions and the latest Node.js versions out-of-the-box despite haven’t been updated in 4 years! I was delighted and intrigued!\n\nIn principle, nar works the same as caxa, using the idea of a self-extracting archive. There are some important differences, though:\n\n1. nar doesn’t support Windows. That’s because nar’s stub is a bash script instead of the Go binary used in caxa.\n2. nar gets some small details wrong. For example, it changes your current working directory to the temporary directory in which the archive is uncompressed. This breaks some assumptions about how command-line tools should work; for example, if you’re project implements `ls` in Node.js, then when running it from nar it’d always list the files in the temporary directory.\n3. It’s no longer maintained. They recommend pkg instead.\n4. It was written in LiveScript, which is significantly more obscure than TypeScript/Go, in which caxa is implemented.\n\n#### <https://github.com/jedi4ever/bashpack>\n\nSimilar to nar. Hasn’t seen activity in 8 years.\n\n#### Other Packages\n\nIf you dig through npm, GitHub, and Google, you’ll find other projects in this space, but I couldn’t find one that had a good combination of working well, being well documented, being well maintained, and so forth.\n\n#### <https://github.com/bake-bake-bake/bakeware>\n\nA similar idea to caxa from our friends in Elixir community.\n\n#### References on Self-Extracting Archives\n\nCreating a self-extracting archive with a bash script for the stub (only works on macOS/Linux, and depends on things like `tar` being available—which they probably are) (this is the inspiration for the Shell Stub):\n\n- <https://peter-west.uk/blog/2019/making-node-script-binaries.html>: This is specific to Node.js applications. It’s similar in spirit to nar and bashpack.\n- <https://github.com/megastep/makeself>\n- <https://www.linuxjournal.com/node/1005818>\n- <https://community.linuxmint.com/tutorial/view/1998>\n- <http://alexradzin.blogspot.com/2015/12/creating-self-extracting-targz.html?m=1>\n- <https://www.matteomattei.com/create-self-contained-installer-in-bash-that-extracts-archives-and-perform-actitions/>\n- <https://www.codeproject.com/Articles/7053/Pure-WIN32-Self-Extract-EXE-Builder>\n- <https://sysplay.in/blog/linux/2019/12/self-extracting-shell-script/>\n- <https://gist.github.com/gregjhogan/bfcffe88ac9d6865efc5>\n\nCreating a self-extracting batch file for Windows (an idea I didn’t pursue, going for the Go stub instead):\n\n- <https://www.dostips.com/forum/viewtopic.php?f=3&t=4842>\n- <http://www.piclist.com/techref//dos/binbat.htm>\n\nOther tools that create self-extracting archives:\n\n- 7-Zip. It was studying 7-Zip that I learned that you can append data to a binary. caxa uses an approach that’s similar to 7-Zip’s to build a self-extracting archive. The major different in the binary layout is that the metadata goes in the footer, instead of between the stub and the archive like in 7-Zip. Switching these two around allows caxa to read the footer and potentially skip looking at the archive altogether if it isn’t the first time you’re running the application and it’s already cached. Unfortunately I couldn’t use 7-Zip itself because it’s tailored for **installers** as opposed to **applications**, so some things don’t work well.\n  - <https://sevenzip.osdn.jp/chm/start.htm>\n  - <https://sevenzip.osdn.jp/chm/cmdline/switches/sfx.htm>\n  - <https://superuser.com/questions/42788/is-it-possible-to-execute-a-file-after-extraction-from-a-7-zip-self-extracting-a>\n  - <http://ntsblog.homedev.com.au/index.php/2015/05/14/self-extracting-archive-runs-setup-exe-7zip-sfx-switch/>\n  - <https://nsis.sourceforge.io/Main_Page>\n  - <https://www.7-zip.org/sdk.html>\n  - <https://superuser.com/questions/1048866/creating-7zip-sfx-installer>\n  - <https://netbeansscribbles.wordpress.com/2015/01/30/creating-a-self-extracting-7zip-archive-multi-platform/>\n  - If 7-Zip had worked, I’d try using one of the following packages to control 7-Zip from Node.js:\n    - <https://www.npmjs.com/package/node-7z-archive>\n    - <https://www.npmjs.com/package/7zip-bin>\n    - <https://www.npmjs.com/package/7zip-bin-wrapper>\n    - <https://www.npmjs.com/package/p7zip>\n    - <https://www.npmjs.com/package/7zip>\n    - <https://www.npmjs.com/package/node-7z>\n    - <https://www.npmjs.com/package/7zip-min>\n- WinZip Self-Extractor: <https://www.winzip.com/> (I didn’t try this.)\n- <https://documentation.help/WinRAR/HELPArcSFX.htm>\n- <https://en.wikipedia.org/wiki/IExpress> (I tried this and it didn’t work. Also I think it’d be difficult to automate. And it’s old technology.)\n\n#### References on Building the Stub in C\n\nBesides Go, I also considered writing the stub in C. Ultimately Go won because it’s less prone to errors and has a better cross-compilation/standard-library story. But C has the advantage of being setup in the machines of Node.js developers because of native dependencies. You could leverage that to use the linker (`ld`) to embed the archive, instead of crudely appending it to the end of the stub. This could be necessary to handle signing…\n\nAnyway, here’s what you could use to build a stub in C:\n\n- Just use `system()` and rely on `tar` being installed (it most certainly is, anyway). At this point C becomes a portable bash stub. <https://www.tutorialspoint.com/c_standard_library/c_function_system.htm>\n- <http://www.libarchive.org>: This is the implementation of `tar` that you find in Windows 10 and many other places.\n  - <https://github.com/libarchive/libarchive/wiki/LibarchiveFormats>\n- <https://zlib.net>: This is the underlying implementation of gzip that [may be the most deployed software library in existence](https://www.sqlite.org/mostdeployed.html). It’s lower level than libarchive.\n- <https://bitbucket.org/proxymlr/bsdtar/src/xtar/contrib/xtar.c>\n- <https://opensource.apple.com/source/libarchive/libarchive-29/libarchive/examples/untar.c.auto.html>\n- <https://github.com/calccrypto/tar>\n- <https://repo.or.cz/libtar.git>\n\n#### References on Creating Self-Extracting Archives in Node.js\n\n- <https://github.com/vk-twiconnect/sfx-creator-service>\n- <https://stackoverflow.com/questions/27904532/how-do-i-make-a-self-extract-and-running-installer>\n\n#### References on the Structure of Executables\n\nA more principled way of building the self-extracting archive is to not append data at the end of the file, but manipulate the stub binary as a data structure. It’s actually three data structures: Portable Executables (Windows), Mach-O (macOS), and ELF (Linux). This idea was abandoned because it’s more work for the packager and for the stub—the `CAXACAXACAXA` separator is a hack that works well enough. But we may have to revisit this to make the executables signable. You can even manipulate binaries with Go standard libraries…\n\nAnyway, here are some references on the subject:\n\n- <https://www.npmjs.com/package/sfxbundler> (This project seems to do exactly what I’m talking about here.)\n  - <https://github.com/touchifyapp/sfx>\n- <https://github.com/AlexanderOMara/portable-executable-signature>\n- <https://github.com/anders-liu/pe-struct>\n- <https://github.com/ironSource/portable-executable>\n- <https://github.com/bennyhat/peid-finder>\n- <https://github.com/lief-project/LIEF>\n\n#### References on Just Appending Data to an Executable Works\n\nThe data that you append is sometimes called an **overlay**.\n\n- <https://stackoverflow.com/questions/5795446/appending-data-to-an-exe>\n- <https://blog.barthe.ph/2009/02/22/change-signed-executable/>\n- <https://edn.embarcadero.com/article/27979>\n- <https://security.stackexchange.com/questions/77336/how-is-the-file-overlay-read-by-an-exe-virus>\n- <https://github.com/jason-klein/signed-nsis-exe-append-payload>\n- <https://stackoverflow.com/questions/5316152/store-data-in-executable>\n\n#### References on Cross-Compilation of CGO\n\n- <https://github.com/karalabe/xgo>\n- <https://github.com/mattn/go-sqlite3>: A popular project using CGO.\n\n#### References on Building macOS Application Bundles (`.app`)\n\n- <https://mathiasbynens.be/notes/shell-script-mac-apps>\n- <http://www.wsanchez.net/software/>\n- <https://sveinbjorn.org/platypus>\n- <https://github.com/subtleGradient/tilde-bin/blob/master/appify>\n- <https://github.com/subtleGradient/Appify-UI>\n- <https://stackoverflow.com/questions/281372/executing-shell-scripts-from-the-os-x-dock>\n- <https://gist.github.com/mathiasbynens/674099>\n- <https://github.com/KosalaHerath/macos-installer-builder>\n- macOS’s Automator can generate `.app`.\n- <https://www.electronjs.org/docs/tutorial/application-distribution>\n\n#### References on How to Untar in Go\n\nThe Go standard library has low-level utilities for handling tarballs. I could have used a higher-level library, but I couldn’t get them to work with an archive that’s in memory (having been extracted from the binary). Besides, relying only on the standard library is good for an easy compilation story. In the end, the solution was to copy and paste a bunch.\n\n- <https://github.com/golang/build/blob/db2c93053bcd6b944723c262828c90af91b0477a/internal/untar/untar.go>\n- <https://github.com/mholt/archiver/tree/v3.5.0>\n- <https://github.com/mholt/archiver/blob/v1.1.2/targz.go>\n- <https://pkg.go.dev/golang.org/x/build/internal/untar> / <https://github.com/k3s-io/k3s/blob/v1.0.1/pkg/untar/untar.go> / <https://pkg.go.dev/github.com/rancher/k3s/pkg/untar>\n- <https://github.com/cloudfoundry/archiver/blob/master/extractor/tgz_extractor.go>\n- <https://gist.github.com/mimoo/25fc9716e0f1353791f5908f94d6e726>\n- <https://stackoverflow.com/questions/57639648/how-to-decompress-tar-gz-file-in-go>\n- <https://gist.github.com/indraniel/1a91458984179ab4cf80>\n- <https://medium.com/@skdomino/taring-untaring-files-in-go-6b07cf56bc07>\n- <https://medium.com/learning-the-go-programming-language/working-with-compressed-tar-files-in-go-e6fe9ce4f51d>\n- <https://github.com/codeclysm/extract>\n\n#### References on How to Execute a Command from Go\n\nIt’d have been nice to use `syscall.Exec()`, which replaces the currently running binary (the stub) with another one (the command you want to run for your application), but `syscall.Exec()` is macOS/Linux-only. So we use `os.Exec()` instead, paying attention to wiring `stdin/stdout/stderr` between the processes, and forwarding the command-line arguments on the way and the status code on the way out. The downside is that there’s an extra process in the process tree.\n\n- <https://github.com/golang/go/issues/30662>\n- <https://golang.org/pkg/os/exec/>\n- <https://golang.org/pkg/syscall/#Exec>\n- <https://pkg.go.dev/golang.org/x/sys>\n- <https://pkg.go.dev/golang.org/x/sys@v0.0.0-20210226181700-f36f78243c0c/unix#Exec>\n- <https://pkg.go.dev/golang.org/x/sys@v0.0.0-20210226181700-f36f78243c0c/windows/mkwinsyscall>\n- <https://stackoverflow.com/questions/10385551/get-exit-code-go>\n\n#### References on the Layout of the Data in the Self-Extracting Archive\n\n- <https://stackoverflow.com/questions/1443158/binary-data-in-json-string-something-better-than-base64>: I played with the idea of including the `ARCHIVE` in the JSON that ended up becoming the `FOOTER`. It’d have been simpler conceptually, because there’d be only the stub and a payload, but embedding binary data in JSON has an overhead.\n- Maybe I could have used multipart/form-data, which is a standard way of interleaving binary data and text. But the layout was so simple that I decided against it. Being able to generate a binary by appending stuff on the command line is handy and cute.\n- <https://github.com/electron/asar>\n\n### What’s up with This Name?\n\ncaxa is a misspelling of **caixa**, which is Portuguese for **box**. I find it amusing to say that you’re putting an application in the **caxa** 📦 🙄\n\n### Conclusion\n\nAs you see from this long README, despite being simple in spirit, caxa is the result of a lot of research and hard work. Simplicity is **hard**. So [support my work](#support).\n\n### Changelog\n\n#### v3.0.1 · 2022-10-15\n\nHotfix of v3.0.0 whose binary detection didn’t work when executed from `npx` 🤦‍♂️\n\n#### v3.0.0 · 2022-10-15\n\nThis version modernizes the codebase in preparation to add new features, for example, the much anticipated <https://github.com/leafac/caxa/pull/60>.\n\nIt doesn’t add or remove features, yet it’s a major version bump because it includes the following backwards-incompatible changes:\n\n- caxa is now [ESM-only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\n- We dropped support for Node.js 14.\n\n#### v2.1.0\n\n- Added a new stub strategy: Shell Stub. It’s a simple Bash script that does the same as the Go stub, except that it takes less space (about 10 lines as opposed to a 2MB Go binary), but it depends on some tools being installed on the end-user machine, for example, `tar`, `tail`, and so forth.\n- Simplified the build/distribution of stubs.\n  - Cross-compile the stubs, to simplify the GitHub Actions architecture. We were already cross-compiling for macOS ARM, so that isn’t a big loss. Most bugs that may arise from this decision would be bugs in the Go cross-compiler, which is unlikely.\n  - Distribute the stubs with the npm package to avoid issues like: https://github.com/leafac/caxa/issues/26, https://github.com/leafac/caxa/pull/28, https://github.com/leafac/caxa/issues/31, and https://github.com/leafac/caxa/pull/32. If you wish to verify that the stubs really were compiled from `stubs/stub.go`, you may run `npm run prepare:stubs`, because the Go compiler appears to be deterministic and always produce the same binaries given the same source (at least that’s what happened in my tests).\n  - Check the stubs in version control, to simplify distribution and the workflow of people who want to help in the JavaScript part of caxa and who may not want to setup Go.\n  - Distribute only one version of the stub for Linux ARMv6 & Linux ARMv7. They happened to be the same binary, anyway—it seems that the Go compiler doesn’t differentiate between these architectures.\n- Added the `--stub` advanced option to specify a custom stub.\n- Added documentation on how to emulate an `--include` option, and why that’s probably a bad idea.\n- Added the `--uncompression-message` advanced option to print a message when uncompressing.\n- Fixed the `--exclude` advanced option in Windows.\n\n#### v2.0.0\n\n- Added support for ARM, both on Linux and macOS. (Thanks @maxb2!)\n- Fixed inconsistent application directory state that would happen if you stopped caxa in the middle of the extraction or if multiple extractions are attempted at once.\n- Added several command-line parameters to customize the build.\n- **[BREAKING]**: Changed the command-line parameters:\n\n  | From          | To                                                                                                               |\n  | ------------- | ---------------------------------------------------------------------------------------------------------------- |\n  | `--directory` | `--input`                                                                                                        |\n  | `--command`   | The last arguments passed to caxa. Use `--` to separate if your command includes something that starts with `-`. |","users":{}}