Comparing version 2.0.6 to 2.0.7
28
index.js
@@ -8,12 +8,6 @@ // 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; | ||
// 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 configfile = '.v8flags.'+process.versions.v8+'.'+user+'.json'; | ||
const exclusions = ['--help']; | ||
@@ -35,16 +29,8 @@ | ||
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(file); | ||
content = require(configpath); | ||
process.nextTick(function () { | ||
@@ -54,3 +40,3 @@ cb(null, content); | ||
} catch (e) { | ||
fs.open(file, 'w+', function (err, fd) { | ||
fs.open(configpath, 'w+', function (err, fd) { | ||
if (err) { | ||
@@ -100,4 +86,2 @@ return cb(fail(err)); | ||
// export .configfile for backwards compatability | ||
module.exports.configfile = module.exports.configFile = configFile; | ||
module.exports.configPath = configPath; | ||
module.exports.configfile = configfile; |
{ | ||
"name": "v8flags", | ||
"description": "Get available v8 flags.", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"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.7 - revert to 2.0.5 behavior. | ||
* 2015-06-15 - v2.0.6 - store cache file in ~/.cache or ~/AppData/Local depending on platform | ||
@@ -28,0 +29,0 @@ * 2015-04-18 - v2.0.5 - attempt to require config file, if this throws for any reason, fopen w+ and re-create |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
45
6583
76