![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
simple-binary-install
Advanced tools
simple-binary-install
A package to facilitate distributing gzipped binary tarballs (.tar.gz
files). This package provides convenience functions for distributing theses binaries via npm and is likely best used as a devDependency in package.json
.
After using binary-install
(on which this is based) I ran an npm audit
and found it depended on an old, vulnerabile axios
version. After modifying the code to use a newer version of axios
I thought, "Why use axios at all!?". Removing the axios
dependency and switching to fetch()
necessitated a new method of extracting the tar package. The tar-stream
package was chosen to fulfill that task.
npm i --save-dev simple-binary-install
or
pnpm i -D simple-binary-install
Usage is very similar to binary-install
The Binary
class allows downloading a tarball containing a binary and extracting it to a given location.
An example of its use is given below using an install.js
file that looks like:
#!/usr/bin/env node
import { Binary } from 'simple-binary-install'
let binary = new Binary('my-binary', 'https://example.com/binary/tar.gz')
binary.install()
If the install location of the binary needs to be modified, the third parameter can be a config object, used to change the installDirectory
. e.g.
#!/usr/bin/env node
import { Binary } from 'simple-binary-install'
let binary = new Binary('my-binary', 'https://example.com/binary/tar.gz', {installDirectory: 'new/location'})
binary.install()
The shebang at the top of the file lets your shell know that this script should be run with the node runtime.
In your package.json
, we would add the following:
{
...
"scripts": {
"postinstall": "node ./install.js"
}
...
}
One more change to your project would be needed before your package is ready to distribute. Make a run.js
file that looks similar to this:
#!/usr/bin/env node
import { Binary } from 'simple-binary-install'
let binary = new Binary('my-binary', 'https://example.com/binary/tar.gz')
binary.run()
And then in your package.json
, add the following:
{
...
"bin": {
"my-binary": "run.js"
}
...
}
Then, we could use it as shown below in a local directory!
pnpm i && npx my-binary --version
1.0.0
This project has been built for the needs of the translocate crate, but PRs to extend its functionality are welcome.
biome is used to lint and format the project's JS files. Before contributing changes please run the format command, e.g. npm run format
.
FAQs
Facilitates distributing gzipped binary tarballs from npm.
We found that simple-binary-install demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.