diff options
author | Mustansir Golawala <mgolawala@gmail.com> | 2012-04-12 01:29:15 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-04-14 23:17:38 +0200 |
commit | 7ee15457edbd634c85b69fb3b865c4e27b17b672 (patch) | |
tree | 15b8d53adc9e933671335ddea0e530e94f244c43 | |
parent | 93cefab1a3a40a5693217c9ce43380a1e1cfad4e (diff) | |
download | android-node-v8-7ee15457edbd634c85b69fb3b865c4e27b17b672.tar.gz android-node-v8-7ee15457edbd634c85b69fb3b865c4e27b17b672.tar.bz2 android-node-v8-7ee15457edbd634c85b69fb3b865c4e27b17b672.zip |
os: add cross platform EOL character
-rw-r--r-- | doc/api/os.markdown | 3 | ||||
-rw-r--r-- | lib/os.js | 2 | ||||
-rw-r--r-- | test/simple/test-os.js | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/os.markdown b/doc/api/os.markdown index 0a8a17fd39..33eb9b6317 100644 --- a/doc/api/os.markdown +++ b/doc/api/os.markdown @@ -129,3 +129,6 @@ Get a list of network interfaces: vmnet8: [ { address: '10.88.88.1', family: 'IPv4', internal: false } ], ppp0: [ { address: '10.2.0.231', family: 'IPv4', internal: false } ] } +## os.EOL + +A constant defining the appropriate End-of-line marker for the operating system. @@ -42,3 +42,5 @@ exports.getNetworkInterfaces = function() { }; module.deprecate('getNetworkInterfaces', 'It is now called `os.networkInterfaces`.'); + +exports.EOL = process.platform === 'win32' ? '\r\n' : '\n'; diff --git a/test/simple/test-os.js b/test/simple/test-os.js index 92d1a264c1..a70142f9f7 100644 --- a/test/simple/test-os.js +++ b/test/simple/test-os.js @@ -79,3 +79,6 @@ switch (platform) { assert.deepEqual(actual, expected); break; } + +var EOL = os.EOL; +assert.ok(EOL.length > 0); |