Skip to content

Commit

Permalink
Shrink package size, update dependencies, fix warnings, and add suppo…
Browse files Browse the repository at this point in the history
…rt for all package managers
  • Loading branch information
marvinroger committed Apr 9, 2023
1 parent a8eb6e0 commit a7428d4
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 923 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,16 @@ This will install go-npm under to your package.json file. It will also create a

`$ rm -r node_modules`

**Add postinstall and preuninstall scripts**
**Add preinstall script**
Here 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.

Edit `package.json` file and add the following:
```
{
"postinstall": "go-npm install",
"preuninstall": "go-npm uninstall",
"preinstall": "go-npm install"
}
```

`go-npm uninstall` simply deletes the binary from `bin` directory before NPM uninstalls your package.

**Configure your binary path**

You 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.
Expand All @@ -74,6 +71,7 @@ You need to tell `go-npm` where to download the binaries from, and where to inst
"name": "command-name",
"path": "./bin",
"url": "https://github.com/user/my-go-package/releases/download/v{{version}}/myGoPackage_{{version}}_{{platform}}_{{arch}}.tar.gz"
}
```

* *name*: Name of the command users will use to run your binary.
Expand Down
Loading

0 comments on commit a7428d4

Please sign in to comment.