Comparing version 0.3.0 to 1.0.0
35
index.js
@@ -1,34 +0,1 @@ | ||
const exec = require('child_process').exec; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
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(2); | ||
}); | ||
fs.writeFile(tmpfile, JSON.stringify(flags), { encoding:'utf8' }, | ||
function (writeErr) { | ||
if (writeErr) { | ||
cb(writeErr); | ||
} else { | ||
cb(null, flags); | ||
} | ||
} | ||
); | ||
}); | ||
} | ||
}); | ||
}; | ||
exports.fetch = require('./fetch'); |
{ | ||
"name": "v8flags", | ||
"description": "List available v8 flags.", | ||
"version": "0.3.0", | ||
"description": "Get available v8 flags.", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/tkellen/node-v8flags", | ||
@@ -23,2 +23,6 @@ "author": { | ||
], | ||
"scripts": { | ||
"install": "node fetch.js", | ||
"test": "mocha -R spec test.js" | ||
}, | ||
"main": "index.js", | ||
@@ -31,3 +35,7 @@ "engines": { | ||
"harmony flags" | ||
] | ||
], | ||
"devDependencies": { | ||
"chai": "~1.9.1", | ||
"mocha": "~1.21.4" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
# v8flags | ||
> List available v8 flags. | ||
# v8flags [![Build Status](https://secure.travis-ci.org/tkellen/node-v8flags.png)](http://travis-ci.org/tkellen/node-v8flags) | ||
> Get available v8 flags. | ||
@@ -10,5 +10,12 @@ [![NPM](https://nodei.co/npm/v8flags.png)](https://nodei.co/npm/v8flags/) | ||
v8flags(function(err, flags) { | ||
console.log(flags); | ||
}); | ||
v8flags.fetch(); // [ '--use_strict', | ||
// '--es5_readonly', | ||
// '--es52_globals', | ||
// '--harmony_typeof', | ||
// '--harmony_scoping', | ||
// '--harmony_modules', | ||
// '--harmony_proxies', | ||
// '--harmony_collections', | ||
// '--harmony', | ||
// ... | ||
``` | ||
@@ -21,1 +28,2 @@ | ||
* 2014-09-02 - v0.3.0 - keep -- in flag names | ||
* 2014-09-03 - v1.0.0 - first major version release |
Sorry, the diff of this file is not supported yet
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4278
8
43
0
28
2
1
3