Socket
Socket
Sign inDemoInstall

flagged-respawn

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flagged-respawn

A tool for respawning node binaries when special flags are present.


Version published
Weekly downloads
2.9M
increased by2.68%
Maintainers
4
Weekly downloads
 
Created

What is flagged-respawn?

The flagged-respawn npm package is designed to facilitate the handling of specific flags in Node.js command-line applications. It allows developers to automatically respawn their node process with selected V8 flags or custom flags that are initially passed, making it easier to work with features or behaviors that require such flags to be enabled.

What are flagged-respawn's main functionalities?

Respawning with V8 flags

This feature allows the application to respawn with specified V8 flags if they are not already enabled. The code sample demonstrates how to use flagged-respawn to check for the '--harmony' flag and respawn the process with it if necessary.

const flaggedRespawn = require('flagged-respawn');

const v8Flags = ['--harmony'];
flaggedRespawn(v8Flags, process.argv, function (ready, child) {
  if (ready) {
    // your app code here
  } else if (child) {
    // this is the child process, do something with it if needed
  }
});

Custom flag handling

This feature supports respawning the process with custom flags. The example shows how to ensure a process respawns with a '--custom-flag', allowing developers to implement custom behavior based on the presence of this flag.

const flaggedRespawn = require('flagged-respawn');

const customFlags = ['--custom-flag'];
flaggedRespawn(customFlags, process.argv, function (ready) {
  if (ready) {
    // your app code here, knowing that --custom-flag is being handled
  }
});

Other packages similar to flagged-respawn

Keywords

FAQs

Package last updated on 11 Dec 2018

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