Created
July 22, 2015 11:38
-
-
Save msikma/14ff35c878b06780ef9a to your computer and use it in GitHub Desktop.
Which of these styles is nicer?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns server environment information and copyright. This is intended | |
* only to be displayed inside of a terminal. | |
* | |
* @returns {String} Copyright and server environment information | |
*/ | |
function getServerInfo() { | |
const engineName = process.title == 'node' ? 'Node.js' | |
: process.title == 'iojs' ? 'io.js' : '(unknown engine)'; | |
const engineVersion = process.title + ' v' + process.versions.node; | |
const enginePlatform = process.platform + '-' + process.arch; | |
return ( | |
copyrightInfo.string('source', true) + os.EOL | |
+ version + os.EOL | |
+ 'Running on ' + engineName + ' (' | |
+ engineVersion + ', ' + enginePlatform + ')' + os.EOL | |
); | |
} | |
/** | |
* Returns server environment information and copyright. This is intended | |
* only to be displayed inside of a terminal. | |
* | |
* @returns {String} Copyright and server environment information | |
*/ | |
function getServerInfo() { | |
let output = ''; | |
const engineName = process.title == 'node' ? 'Node.js' | |
: process.title == 'iojs' ? 'io.js' : '(unknown engine)'; | |
const engineVersion = process.title + ' v' + process.versions.node; | |
const enginePlatform = process.platform + '-' + process.arch; | |
output += copyrightInfo.string('source', true) + os.EOL; | |
output += version + os.EOL; | |
output += 'Running on ' + engineName + ' (' | |
+ engineVersion + ', ' + enginePlatform + ')' + os.EOL; | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment