native File.read, File.write etc... for Opal
Opal's File class does not have methods for file IO but this module provides them.
This provides...
File
(partial; no #open and #new)File::Stat
(partial)FileTest
(partial)Errno::EXXX
Pull requests are welcome!
Add this line to your application's Gemfile:
gem 'opal-file'
And then execute:
$ bundle
Or install it yourself as:
$ gem install opal-file
write foo.rb
require "opal-file"
puts File.read("./foo")
and compile
opal --gem opal-file foo.rb > foo.js
and run!
node foo.js
Bug reports and pull requests are welcome on GitHub at https://github.com/Narazaka/opal-file.
This is released under MIT License