Socket
Socket
Sign inDemoInstall

v8flags

Package Overview
Dependencies
0
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    v8flags

Get available v8 and Node.js flags.


Version published
Weekly downloads
3.7M
decreased by-12.77%
Maintainers
2
Install size
9.53 kB
Created
Weekly downloads
 

Package description

What is v8flags?

The v8flags npm package is used to fetch the flags available for the V8 JavaScript engine that Node.js runs on. It provides an API to programmatically access the list of V8 command-line flags, which can be useful for tools that spawn child processes of Node.js and need to pass flags to the V8 engine.

What are v8flags's main functionalities?

Fetching V8 flags

This feature allows you to fetch the available V8 flags for the current version of Node.js. The flags are returned as an array of strings, each representing a command-line flag that can be used with V8.

const v8flags = require('v8flags');
v8flags.then(flags => console.log(flags));

Caching V8 flags

v8flags caches the flags to a file to avoid the performance cost of spawning a new process on subsequent calls. You can specify a custom cache directory by configuring the package.

const v8flags = require('v8flags');
v8flags.config({
  cacheDir: '/path/to/cache/directory'
});
v8flags.then(flags => console.log(flags));

Other packages similar to v8flags

Readme

Source

v8flags

NPM version Downloads Build Status Coveralls Status

Get available v8 and Node.js flags.

Usage

const v8flags = require('v8flags');

v8flags(function (err, results) {
  console.log(results);
  // [ '--use_strict',
  //   '--es5_readonly',
  //   '--es52_globals',
  //   '--harmony_typeof',
  //   '--harmony_scoping',
  //   '--harmony_modules',
  //   '--harmony_proxies',
  //   '--harmony_collections',
  //   '--harmony',
  // ...
});

API

v8flags(cb)

Finds the available flags and calls the passed callback with any errors and an array of flag results.

v8flags.configfile

The name of the cache file for flags.

v8flags.configPath

The filepath location of the configfile above.

License

MIT

Keywords

FAQs

Last updated on 03 Sep 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc