Sha256: 187cbaaa8d0e7fbdf6936aba97284902272b015628d6e18e392ed7d5e832e219

Contents?: true

Size: 727 Bytes

Versions: 6

Compression:

Stored size: 727 Bytes

Contents

# backtick_javascript: true

module NodeJS
  VERSION = `process.version`
end

`Opal.exit = process.exit`

ARGV = `process.argv.slice(2)`
ARGV.shift if ARGV.first == '--'

STDOUT.write_proc = ->(string) { `process.stdout.write(string)` }
STDERR.write_proc = ->(string) { `process.stderr.write(string)` }

`var __fs__ = require('fs')`
STDIN.read_proc = %x{function(_count) {
  // Ignore count, return as much as we can get
  var buf = Buffer.alloc(65536), count;
  try {
    count = __fs__.readSync(this.fd, buf, 0, 65536, null);
  }
  catch (e) { // Windows systems may raise EOF
    return nil;
  }
  if (count == 0) return nil;
  return buf.toString('utf8', 0, count);
}}

STDIN.tty = true
STDOUT.tty = true
STDERR.tty = true

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 stdlib/nodejs/base.rb
opal-1.8.2 stdlib/nodejs/base.rb
opal-1.8.1 stdlib/nodejs/base.rb
opal-1.8.0 stdlib/nodejs/base.rb
opal-1.8.0.beta1 stdlib/nodejs/base.rb
opal-1.8.0.alpha1 stdlib/nodejs/base.rb