
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
A cli tool by @bjesuiter which takes one or more binaries for different platforms and wraps them into an npm package for distribution. Can also be used via bin2npm package on npmjs.org
A helper cli which takes one or more binaries for different platforms and wraps them into an npm package for distribution.
Opt1: Run directly from JSR
deno run --allow-read='.' --allow-write='.' jsr:@bjesuiter/bin2npm --config ./bin2npm.toml
Opt2: Install globally on your host machine from JSR
deno install --global --allow-read='.' --allow-write='.' -n bin2npm jsr:@bjesuiter/bin2npm
Package URL: https://www.npmjs.com/package/bin2npm
Opt1: Run directly from npm
# with config file search
npx bin2npm
# with explicit config file
npx bin2npm --config ./bin2npm.toml
Opt2: Install on your host machine from npm
# global install
npm i -g bin2npm
# local install
npm i -D bin2npm
Package URL: https://www.npmjs.com/package/bin2npm
Opt1: Run directly from bun
bunx bin2npm --config ./bin2npm.toml
Opt2: Install globally on your host machine from bun
# global install
bun i -g bin2npm
# local install
bun i -D bin2npm
bin2npm
(only works when installed globally, alternatively use npx, bunx, or direct running via jsr)
=> It will search for all bin2npm.toml files inside your CWDbin2npm --config ./bin2npm.toml
to specify a config file directlyIf you have any issues, please open an Issue at: https://github.com/bjesuiter/bin2npm/issues
# File: bin2npm.toml
bin2NpmVersion = "0"
outDir = "npm"
[targetPackageJson]
name = "bin2npm"
version = "0.0.6"
description = "A cli tool by @bjesuiter which takes one or more binaries for different platforms and wraps them into an npm package for distribution. Can also be used via bin2npm package on npmjs.org"
[[binaries]]
# path to the binary you want to wrap, based on the cwd where you run bin2npm
path = "compiled/bin2npm_linux_x64"
# platform should be one of nodejs's os.platform() values:
# for Node 16 LTS: 'aix', 'darwin', 'freebsd','linux', 'openbsd', 'sunos', and 'win32'
# see https://nodejs.org/docs/latest-v16.x/api/os.html#osplatform
# These are only the allowed values. You have to provide the correct binary for this to work.
platform = "linux"
# arch should be one of nodejs's os.arch() values:
# for Node 16 LTS: 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', and 'x64'
# see https://nodejs.org/docs/latest-v16.x/api/os.html#osarch
# These are only the allowed values. You have to provide the correct binary for this to work.
arch = "x64"
[[binaries]]
path = "compiled/bin2npm_macos_x64"
platform = "darwin"
arch = "x64"
[[binaries]]
path = "compiled/bin2npm_macos_arm"
platform = "darwin"
arch = "arm64"
[[binaries]]
path = "compiled/bin2npm_windows_x64.exe"
platform = "win32"
arch = "x64"
# copy extra files from the current directory into the npm package
[[extraAssets]]
from = "Readme.md"
to = "Readme.md"
Use asset-builder
from (https://jsr.io/@codemonument/asset-builder) to have the template folder available to the deno cli.
Run deno task pack-assets
to pack the files in /template
into src/gen/assets.ts
Must be used in the npm AND the deno variant of this package, otherwise this cli will not work when installed from jsr.io!
cli.ts
for the bin2npm cli --version commanddeno.jsonc
for the JSR deployment of this package./bin2npm.toml
deno task pack-assets
deno task compile
to compile the deno scripts with the deno executable into self-contained executablesdeno task assemble-npm
=> This runs bin2npm on the compiled output of itself! (Great, isn't it?!?)deno task publish-npm
to publish on npmFAQs
A cli tool by @bjesuiter which takes one or more binaries for different platforms and wraps them into an npm package for distribution. Can also be used via bin2npm package on npmjs.org
We found that bin2npm demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.