Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Node.js vs io.js detection #10658

Closed
jasonsanjose opened this issue Feb 26, 2015 · 4 comments
Closed

Node.js vs io.js detection #10658

jasonsanjose opened this issue Feb 26, 2015 · 4 comments
Labels

Comments

@jasonsanjose
Copy link
Member

Now that io.js has forked, modules like node-sass are relying on the name of the executable to detect node vs. io.js.

Examples:

https://github.com/sass/node-sass/blob/master/lib/extensions.js#L9 resolves to Brackets-node

function getRuntimeInfo() {
  var execPath = fs.realpathSync(process.execPath); // resolve symbolic link

  var runtime = execPath
               .split(/[\\/]+/).pop()
               .split('.').shift();

  runtime = runtime === 'nodejs' ? 'node' : runtime;

  return {
    name: runtime,
    execPath: execPath
  };
}

Another example at stackexchange uses the same technique http://stackoverflow.com/questions/28259154/is-there-a-reliable-way-of-detecting-whether-io-js-or-node-js-is-running?rq=1.

Part of the responsibility should be on packages to do more robust detection. However, my question is, is there still a compelling reason to name our binary Brackets-node?

@jasonsanjose
Copy link
Member Author

Also, it's worth noting that node-sass is fixing their approach in a future release sass/node-sass#694.

@peterflynn
Copy link
Member

I think @busykai was looking into trying to rename the binary back to just plain node. IIRC there was some problem with our native extension for Windows file watching if we didn't rename it...?

@busykai
Copy link
Contributor

busykai commented Mar 3, 2015

@peterflynn, I was going the other way, actually. :) I wanted to rename Windows node.exe to Brackets-node.exe.

@jasonsanjose, I believe the major reason to have it as Brackets-node is to be able to distinguish it from other node processes which could be running on the system (for example, if one wanted to debug or restart it).

@petetnt
Copy link
Collaborator

petetnt commented Sep 3, 2016

Not valid issue anymore, closing

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants