{"_id":"@dkourkouzelis/go-npm","_rev":"5-5c6124339c5bca726ab290c378542fa3","name":"@dkourkouzelis/go-npm","dist-tags":{"latest":"0.1.17"},"versions":{"0.1.13":{"name":"@dkourkouzelis/go-npm","version":"0.1.13","description":"Distribute and install Go binaries via NPM","main":"index.js","bin":{"go-npm":"bin/index.js"},"scripts":{"test":"jest","build":"rm -rf ./bin && esbuild --bundle src/index.js --outfile=\"./bin/index.js\" --platform=node --target=es6 --minify-whitespace","prepublishOnly":"npm i && npm run build"},"author":{"name":"Sanath Kumar Ramesh","email":"dayanandasaraswati@gmail.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dkourkouzelis/go-npm.git"},"homepage":"https://github.com/dkourkouzelis/go-npm","devDependencies":{"esbuild":"^0.12.17","jest":"^24.5.0","mkdirp":"^1.0.4","request":"^2.88.2","tar":"^2.2.2","unzipper":"0.10.10"},"_id":"@dkourkouzelis/go-npm@0.1.13","gitHead":"e1b072bd3de0f2970f175515b30bbeffad27ed5a","bugs":{"url":"https://github.com/dkourkouzelis/go-npm/issues"},"_nodeVersion":"18.18.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-kYmj+F3JSnDnuII8GZZq/x5xCjTUHP3OZ10ZaZp6xrL0NVGox3zZV9iAaXrIebNUJPeBU/0Qn7So+ogtg5FAXw==","shasum":"61c0f822889d7cf565edefca57dc3f1f9cc903cc","tarball":"https://registry.npmjs.org/@dkourkouzelis/go-npm/-/go-npm-0.1.13.tgz","fileCount":4,"unpackedSize":1319564,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMeTweAnZX6xz2c7uXaAJnVf0xaOlw1uFIVdILk+Sw1AiEAiSZ6p5irL1KKN0BEZmAA27ZrMiq7xbkauvi7vmafx3Q="}]},"_npmUser":{"name":"dkourkouzelis","email":"diamantis@endor.ai"},"directories":{},"maintainers":[{"name":"dkourkouzelis","email":"diamantis@endor.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/go-npm_0.1.13_1697150911986_0.2739985870058632"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.14":{"name":"@dkourkouzelis/go-npm","version":"0.1.14","description":"Distribute and install Go binaries via NPM","main":"index.js","bin":{"go-npm":"bin/index.js"},"scripts":{"test":"jest","build":"rm -rf ./bin && esbuild --bundle src/index.js --outfile=\"./bin/index.js\" --platform=node --target=es6 --minify-whitespace","prepublishOnly":"npm i && npm run build"},"author":{"name":"Sanath Kumar Ramesh","email":"dayanandasaraswati@gmail.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dkourkouzelis/go-npm.git"},"homepage":"https://github.com/dkourkouzelis/go-npm","devDependencies":{"esbuild":"^0.12.17","jest":"^24.5.0","mkdirp":"^1.0.4","request":"^2.88.2","tar":"^2.2.2","unzipper":"0.10.10"},"_id":"@dkourkouzelis/go-npm@0.1.14","gitHead":"985c31c36753d88177d27be49eb67cd325130b31","bugs":{"url":"https://github.com/dkourkouzelis/go-npm/issues"},"_nodeVersion":"18.18.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-xtgThph1nSjmi6r11jX3gTcahIoZmFLhlGGahqsT8FH2zTXom/kMZ6kLehGPhOgmq/zw+IPxkVBUTzCuwirgaA==","shasum":"aa9538a69c6c9ec6a86c46a9367dea8eceddd671","tarball":"https://registry.npmjs.org/@dkourkouzelis/go-npm/-/go-npm-0.1.14.tgz","fileCount":4,"unpackedSize":1319732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAynodWxnyoCHqOTyXlX/n7nT7qKzzyj4dajeZvEYysFAiEAwljCc1kuJ4OUlQzyqK3iml9hi+ri+WxsxKiWvGozUn0="}]},"_npmUser":{"name":"dkourkouzelis","email":"diamantis@endor.ai"},"directories":{},"maintainers":[{"name":"dkourkouzelis","email":"diamantis@endor.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/go-npm_0.1.14_1697648290236_0.31206331801076215"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.15":{"name":"@dkourkouzelis/go-npm","version":"0.1.15","description":"Distribute and install Go binaries via NPM","main":"index.js","bin":{"go-npm":"bin/index.js"},"scripts":{"test":"jest","build":"rm -rf ./bin && esbuild --bundle src/index.js --outfile=\"./bin/index.js\" --platform=node --target=es6 --minify-whitespace","prepublishOnly":"npm i && npm run build"},"author":{"name":"Sanath Kumar Ramesh","email":"dayanandasaraswati@gmail.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dkourkouzelis/go-npm.git"},"homepage":"https://github.com/dkourkouzelis/go-npm","devDependencies":{"esbuild":"^0.12.17","jest":"^24.5.0","mkdirp":"^1.0.4","request":"^2.88.2","tar":"^2.2.2","unzipper":"0.10.10"},"_id":"@dkourkouzelis/go-npm@0.1.15","gitHead":"8ba74aa7999687e48a09bc494b71b8ba2d542ebc","bugs":{"url":"https://github.com/dkourkouzelis/go-npm/issues"},"_nodeVersion":"18.18.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-mSfoT6DZ+VdP2T6nfP6xMxhwPK6XotIkBh4HjsihGRq9PGHS5h0Ui/0VcaLZzoQfEkVYwClO6msvOtgjCJ2S2g==","shasum":"7ba32ea94d792efdc2cb5fa4dba1aa8bbf4976ff","tarball":"https://registry.npmjs.org/@dkourkouzelis/go-npm/-/go-npm-0.1.15.tgz","fileCount":4,"unpackedSize":1319564,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEtUfQKslsixeabyfAnUKvOcYeWEq/etr/K+WFZSk4OcAiBCw2qiPEw/NoYoAj6G8ryVPdW5wJNwkFGdFgM6GA7n4A=="}]},"_npmUser":{"name":"dkourkouzelis","email":"diamantis@endor.ai"},"directories":{},"maintainers":[{"name":"dkourkouzelis","email":"diamantis@endor.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/go-npm_0.1.15_1697649678990_0.20569401673415388"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.16":{"name":"@dkourkouzelis/go-npm","version":"0.1.16","description":"Distribute and install Go binaries via NPM","main":"index.js","bin":{"go-npm":"bin/index.js"},"scripts":{"test":"jest","build":"rm -rf ./bin && esbuild --bundle src/index.js --outfile=\"./bin/index.js\" --platform=node --target=es6 --minify-whitespace","prepublishOnly":"npm i && npm run build"},"author":{"name":"Sanath Kumar Ramesh","email":"dayanandasaraswati@gmail.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dkourkouzelis/go-npm.git"},"homepage":"https://github.com/dkourkouzelis/go-npm","devDependencies":{"esbuild":"^0.12.17","jest":"^24.5.0","mkdirp":"^1.0.4","request":"^2.88.2","tar":"^2.2.2","unzipper":"0.10.10"},"_id":"@dkourkouzelis/go-npm@0.1.16","gitHead":"160db559b90bba2a51cec76d0fb139021c594e62","bugs":{"url":"https://github.com/dkourkouzelis/go-npm/issues"},"_nodeVersion":"18.18.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-+ViFn7yTqNTfSO7DRmWtw0zChLZ2QCo5i6162UTg/nPg7F/izawioUz0KtOfZ4T9vEe0fsCmyHJFE64M18k2kQ==","shasum":"64fc2c606adccd1e892593a68fab7d02b336c7ae","tarball":"https://registry.npmjs.org/@dkourkouzelis/go-npm/-/go-npm-0.1.16.tgz","fileCount":4,"unpackedSize":1319668,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzhbc7B2r2xWr0jGUHbL04jsvKFeobStnsUFqLI4lYewIhAM5+bYux55AHzphTvAZTamjW7ZIqeNnxCCmXBs+FfRSk"}]},"_npmUser":{"name":"dkourkouzelis","email":"diamantis@endor.ai"},"directories":{},"maintainers":[{"name":"dkourkouzelis","email":"diamantis@endor.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/go-npm_0.1.16_1697659820858_0.16778487352450044"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.17":{"name":"@dkourkouzelis/go-npm","version":"0.1.17","description":"Distribute and install Go binaries via NPM","main":"index.js","bin":{"go-npm":"bin/index.js"},"scripts":{"test":"jest","build":"rm -rf ./bin && esbuild --bundle src/index.js --outfile=\"./bin/index.js\" --platform=node --target=es6 --minify-whitespace","prepublishOnly":"npm i && npm run build"},"author":{"name":"Sanath Kumar Ramesh","email":"dayanandasaraswati@gmail.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/dkourkouzelis/go-npm.git"},"homepage":"https://github.com/dkourkouzelis/go-npm","devDependencies":{"esbuild":"^0.12.17","jest":"^24.5.0","mkdirp":"^1.0.4","request":"^2.88.2","tar":"^2.2.2","unzipper":"0.10.10"},"_id":"@dkourkouzelis/go-npm@0.1.17","gitHead":"609a3f549231da7adb94e249c614d91266d93cc8","bugs":{"url":"https://github.com/dkourkouzelis/go-npm/issues"},"_nodeVersion":"18.18.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-NjQXT4eTIs2B7rFjJE40x9LiH/ch4sh8If6hz3DoadX1Qzfn1F4scEKQ/7kSErY4j8lb34aaWsQo5NEHpYzcWA==","shasum":"8c635e9ebcdfb2e6b9085069b99b8913c79ebbc8","tarball":"https://registry.npmjs.org/@dkourkouzelis/go-npm/-/go-npm-0.1.17.tgz","fileCount":4,"unpackedSize":1319638,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7fglqE0/YzESJmW+KHWSRlj0ppY0Yeu0kvBWp5WUEZwIgNsItEPdupW4HJBq8EYFFauziw33p+qC4hCcCQNQKa+U="}]},"_npmUser":{"name":"dkourkouzelis","email":"diamantis@endor.ai"},"directories":{},"maintainers":[{"name":"dkourkouzelis","email":"diamantis@endor.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/go-npm_0.1.17_1697660448255_0.18865747364469732"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2023-10-12T22:48:31.857Z","0.1.13":"2023-10-12T22:48:32.299Z","modified":"2023-10-18T20:49:38.629Z","0.1.14":"2023-10-18T16:58:10.586Z","0.1.15":"2023-10-18T17:21:19.218Z","0.1.16":"2023-10-18T20:10:21.084Z","0.1.17":"2023-10-18T20:20:48.481Z"},"maintainers":[{"name":"dkourkouzelis","email":"diamantis@endor.ai"}],"description":"Distribute and install Go binaries via NPM","homepage":"https://github.com/dkourkouzelis/go-npm","repository":{"type":"git","url":"git+https://github.com/dkourkouzelis/go-npm.git"},"author":{"name":"Sanath Kumar Ramesh","email":"dayanandasaraswati@gmail.com"},"bugs":{"url":"https://github.com/dkourkouzelis/go-npm/issues"},"license":"Apache-2.0","readme":"## Go NPM\n\n### (@gzuidhof): MODIFICATIONS FROM BASE `go-npm` PACKAGE\n* Support for zip and non-compressed binaries.\n* Added support for `arm64` architecture.\n* Fix for use on Windows platform (the binary would get placed in the wrong place for consumers).\n* Shipped as a bundle using `esbuild`, removing 70 packages of dependencies (including huge things like Babel). Now your users will only have to download one additional package (`@gzuidhof/go-npm`).\n\n### Distribute cross-platform Go binaries via NPM\n\nApplications written in Golang are portable - you can easily cross-compile binaries that work on Windows, Mac, and Linux. But how do you distribute the binaries to customers? When you publish new releases, how do they update the binary?\n\n**Use NPM to distribute cross-platform Go binaries**\n\n## Kidding me! Why NPM?\n* **Cross-platform**: NPM is the only popular package manager that works cross-platform.\n* **Lower barier to entry**: Most developers have NPM installed already.\n* **Pain free publishing**: It just takes one command to publish - `npm publish`\n* **Dead simple install & update story**: `npm install/update -g your-awesome-app`\n* **Adds $PATH**: NPM will automatically add your binary location to $PATH and generate .cmd file for Windows. Your app just works after installation!\n\n## Okay, tell me how?\n### 1. Publish your binaries\nSetup your Go application to compile and publish binaries to a file server. This could be Github Releases or Amazon S3 or even Dropbox. All you need is a link.\n\nI like to use [GoReleaser](https://github.com/goreleaser/goreleaser) to setup by release process. You create a simple YAML configuration file like this and run `goreleaser` CLI to publish binaries for various platform/architecture combination to Github:\n\n```\n# .goreleaser.yml\n# Build customization\nbuilds:\n  - binary: drum-roll\n    goos:\n      - windows\n      - darwin\n      - linux\n    goarch:\n      - amd64\n```\n\n`go-npm` will pull the appropriate binary for the platform & architecture where the package is being installed.\n\n### 2. Create a package.json file for your NPM app\nTo publish to NPM, you need to create a `package.json` file. You give your application a name, link to Readme, Github repository etc, and more importantly add `go-npm` as a dependency. You can create this file in an empty directory in your project or in a separate Git repository altogether. It is your choice.\n\n**Create package.json**\n\n`$ npm init`\n\nAnswer the questions to create an initial package.json file\n\n**Add go-npm dependency**\n\nFrom the directory containing package.json file, do\n\n`$ npm install @gzuidhof/go-npm --save`\n\nThis will install go-npm under to your package.json file. It will also create a `node_modules` directory where the `go-npm` package is downloaded. You don't need this directory since you are only going to publish the module and not consume it yourself. Let's go ahead and delete it.\n\n`$ rm -r node_modules`\n\n**Add postinstall and preuninstall scripts**\nHere is the magic: You ask to run `go-npm install` after it completes installing your package. This will pull down binaries from Github or Amazon S3 and install in NPM's `bin` directory. Binaries under bin directory are immediately available for use in your Terminal.\n\nEdit `package.json` file and add the following:\n```\n\"scripts\": {\n    \"postinstall\": \"go-npm install\",\n    \"preuninstall\": \"go-npm uninstall\",\n}\n```\n\n`go-npm uninstall` simply deletes the binary from `bin` directory before NPM uninstalls your package.\n\n**Configure your binary path**\n\nYou need to tell `go-npm` where to download the binaries from, and where to install them. Edit `package.json` file and add the following configuration.\n\n```\n\"goBinary\": {\n      \"name\": \"command-name\",\n      \"path\": \"./bin\",\n      \"url\": \"https://github.com/user/my-go-package/releases/download/v{{version}}/myGoPackage_{{version}}_{{platform}}_{{arch}}.tar.gz\"\n```\n\n* *name*: Name of the command users will use to run your binary.\n* *path*: Temporary path where binaries will be downloaded to\n* *url*: HTTP Web server where binaries are hosted.\n\nFollowing variables are available to customize the URL:\n* `{{version}}`: Version number read from  `package.json` file. When you publish your package to NPM, it will use this version number. Ex: 0.0.1\n* `{{platform}}`: `$GOOS` value for the platform\n* `{{arch}}`: `$GOARCH` value for the architecture\n* `{{win_ext}}`: optional `.exe` extension for windows assets.\n\nIf you use `goreleaser` to publish your modules, it will automatically set the right architecture & platform in your URL.\n\n**Publish to NPM**\n\nAll that's left now is publish to NPM. As I promised before, just one command\n\n`$ npm publish`\n\n### 3. Distribute to users\n\nTo install:\n\n`npm install -g your-app-name`\n\nTo Update:\n\n`npm update -g your-app-name`\n\n\n---\n\nWith ❤️ to the community by [Sanath Kumar Ramesh](http://twitter.com/sanathkr_)\n","readmeFilename":"README.md"}