Socket
Socket
Sign inDemoInstall

v8flags

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v8flags - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

28

index.js

@@ -8,6 +8,12 @@ // this entire module is depressing. i should have spent my time learning

const path = require('path');
const execFile = require('child_process').execFile;
const env = process.env;
const user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
const configfile = '.v8flags.'+process.versions.v8+'.'+user+'.json';
// include v8 version to ensure this works across upgrades of node
// include username to ensure this works across multiple users when
// a home directory can't be found.
const configFile = '.v8flags.'+process.versions.v8+'.'+user+'.json';
const exclusions = ['--help'];

@@ -29,8 +35,16 @@

function configPath () {
const userHome = require('user-home');
const isWindows = process.platform === 'win32';
const baseDir = userHome || os.tmpdir();
const cachePath = isWindows ? path.join('AppData', 'Local') : '.cache';
const configPath = userHome ? path.join(baseDir, cachePath) : baseDir;
return path.join(configPath, configFile);
}
function openConfig (cb) {
var userHome = require('user-home');
var configpath = path.join(userHome || os.tmpdir(), configfile);
var content;
var file = configPath();
try {
content = require(configpath);
content = require(file);
process.nextTick(function () {

@@ -40,3 +54,3 @@ cb(null, content);

} catch (e) {
fs.open(configpath, 'w+', function (err, fd) {
fs.open(file, 'w+', function (err, fd) {
if (err) {

@@ -86,2 +100,4 @@ return cb(fail(err));

module.exports.configfile = configfile;
// export .configfile for backwards compatability
module.exports.configfile = module.exports.configFile = configFile;
module.exports.configPath = configPath;
{
"name": "v8flags",
"description": "Get available v8 flags.",
"version": "2.0.5",
"version": "2.0.6",
"homepage": "https://github.com/tkellen/node-v8flags",

@@ -6,0 +6,0 @@ "author": {

@@ -26,2 +26,3 @@ # v8flags [![Build Status](https://secure.travis-ci.org/tkellen/js-v8flags.png)](http://travis-ci.org/tkellen/js-v8flags) [![Build status](https://ci.appveyor.com/api/projects/status/9psgmwayx9kpol1a?svg=true)](https://ci.appveyor.com/project/tkellen/js-v8flags)

* 2015-06-15 - v2.0.6 - store cache file in ~/.cache or ~/AppData/Local depending on platform
* 2015-04-18 - v2.0.5 - attempt to require config file, if this throws for any reason, fopen w+ and re-create

@@ -28,0 +29,0 @@ * 2015-04-16 - v2.0.4 - when concurrent processes are run and no config exists, don't append to the cached config.

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