Comparing version 0.1.0 to 0.2.0
36
index.js
const exec = require('child_process').exec; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
// TODO: cache this to a file in the module matching the version number of v8 | ||
module.exports = function (callback) { | ||
exec('node --v8-options', function (err, result) { | ||
callback(err, result.match(/\s\s--(\w+)/gm).map(function (match) { | ||
return match.substring(4); | ||
})); | ||
const version = process.versions.v8; | ||
const tmpfile = path.join(__dirname, '.flags-'+version); | ||
module.exports = function (cb) { | ||
fs.exists(tmpfile, function (exists) { | ||
if (exists) { | ||
fs.readFile(tmpfile, function (err, flags) { | ||
if (err) { | ||
cb(err); | ||
} | ||
cb(null, JSON.parse(flags)); | ||
}); | ||
} else { | ||
exec('node --v8-options', function (err, result) { | ||
var flags = result.match(/\s\s--(\w+)/gm).map(function (match) { | ||
return match.substring(4); | ||
}); | ||
fs.writeFile(tmpfile, JSON.stringify(flags), { encoding:'utf8' }, | ||
function (writeErr) { | ||
if (writeErr) { | ||
cb(writeErr); | ||
} else { | ||
cb(null, flags); | ||
} | ||
} | ||
); | ||
}); | ||
} | ||
}); | ||
}; |
{ | ||
"name": "v8flags", | ||
"description": "List available v8 flags.", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/tkellen/node-v8flags", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -1,2 +0,2 @@ | ||
# v8flags [![Build Status](https://secure.travis-ci.org/tkellen/node-v8flags.png?branch=master)](http://travis-ci.org/tkellen/node-v8flags) | ||
# v8flags | ||
> List available v8 flags. | ||
@@ -18,1 +18,2 @@ | ||
* 2014-05-09 - v0.1.0 - initial release | ||
* 2014-09-02 - v0.2.0 - cache flags |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2948
5
32
19
1
1