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

spawn-runtime

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

spawn-runtime

Run prebuilt binary based on the process platform and arch

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

spawn-runtime

Run prebuilt binary based on the process platform and arch

npm i spawn-runtime

Usage

bin/thing

#!/usr/bin/env node
require('spawn-runtime')('thing-runtime', __filename)

Executes bin[thing] from node_modules/thing-runtime-linux-x64/package.json

Export the path

Optionally, the binary path can also be exported to spawn it via code:

index.js

const runtime = require('spawn-runtime')
module.exports = runtime('thing-runtime', 'thing', { spawn: false })

another-project/app.js

const { spawn } = require('child_process')
const thingPath = require('../index.js')

const thing = spawn(thingPath, ...)

API

runtime(name, referrer, [options])

Execs the bin that matches the basename of referrer, from:

node_modules/{name}-{platform}-{arch}/package.json

Available options:

{
  platform: process.platform,
  arch: process.arch,
  spawn: true // Disable it to return the actual binary path instead
}

License

Apache-2.0

FAQs

Package last updated on 28 Apr 2024

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