Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-iojs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-iojs - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

31

index.js
var deprecate = require('util').deprecate;
var version = process.version;
var _isIo = parseInt(version.match(/^v(\d+)\./)[1]) >= 1;
var isIojs = parseInt(version.match(/^v(\d+)\./)[1]) >= 1;
var reliableCheck = null;
module.exports = function() {
return _isIo;
return isIojs;
};
var safeCheck = null;
module.exports.reliable = function() {
if (safeCheck) {
return safeCheck;
}
var isIo = _isIo;
if (reliableCheck) return reliableCheck;
if (isIo && !~['v1.0.0','v1.0.1'].indexOf(version)) {
var _isIojs = isIojs;
if (isIojs && !~['v1.0.0','v1.0.1'].indexOf(version)) {
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var temp = require('os').tmpdir();
var helpFile = path.join(process.cwd(), '.is-iojs-help-ey4Be6vDPrGfXGey4Be6vDPrGfXG');
var doneFile = path.join(process.cwd(), '.is-iojs-done-ey4Be6vDPrGfXGey4Be6vDPrGfXG');
var execPath = process.execPath;
var helpFile = path.join(temp, 'is-iojs-help-ey4Be6vDPrGfXGey4Be6vDPrGfXG');
var doneFile = path.join(temp, 'is-iojs-done-ey4Be6vDPrGfXGey4Be6vDPrGfXG');
exec(execPath + ' -h > ' + helpFile + '&& echo "done" > ' + doneFile);
exec(process.execPath + ' -h > ' + helpFile + '&& echo "done" > ' + doneFile);
while (!fs.existsSync(doneFile)) {}
var helpMessage = fs.readFileSync(helpFile, { encoding: 'ascii' });
isIo = /iojs\.org/.test(helpMessage);
_isIojs = /iojs\.org/.test(fs.readFileSync(helpFile, { encoding: 'ascii' }));

@@ -37,7 +34,5 @@ fs.unlinkSync(helpFile);

return safeCheck = function() {
return isIo;
};
return reliableCheck = function() { return _isIojs };
};
module.exports.safe = deprecate(module.exports.reliable, '.safe() method is deprecated. Use .reliable() instead of it.');
{
"name": "is-iojs",
"version": "0.3.1",
"version": "0.3.2",
"description": "Determines if runtime is iojs",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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