Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

binary-distributor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binary-distributor

Lightweight library to distribute binaries via npm

  • 0.0.2
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

binary-distributor

binary-distributor is an npm package that simplifies the distribution of platform-specific binary applications via npm. It allows you to include and install pre-built binaries based on the user's system and architecture along with your JavaScript module.

Usage

Initialize minimal npm package:

npm init -y

Pay attentions fields name and version should be defined and same as in your binary package.

Install binary-distributor:

npm install binary-distributor --save-dev

Add postinstall and preuninstall scripts to your package.json:

{
  "scripts": {
    "postinstall": "binary-distributor install",
    "preuninstall": "binary-distributor uninstall"
  }
}

Add binary-distributor section to your package.json:

{
  "binary-distributor": {
    "url-template": "url/to/your/binary.tar.gz"
  }
}

Following variables are available to customize the URL template:

  • {name} - Name of the package read from package.json file.
  • {version} - Version number read from package.json file.
  • {platform} - Name of the operating system (Read more).
  • {arch} - The operating system CPU architecture (Read more).

Create launch script launch.js with following content:

#!/usr/bin/env node
require('binary-distributor')
  .launch(__dirname);

Add bin section to your package.json:

{
  "bin": "./launch.js"
}

Then you can publish your package to npm registry:

npm publish

Support project


Keywords

FAQs

Package last updated on 31 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc