Project

opal-file

0.0
No commit activity in last 3 years
No release in over 3 years
native File.read, File.write etc... for Opal
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
>= 0
~> 10.0
 Project Readme

opal-file

native File.read, File.write etc... for Opal

What is this?

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!

Installation

Add this line to your application's Gemfile:

gem 'opal-file'

And then execute:

$ bundle

Or install it yourself as:

$ gem install opal-file

Usage

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

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Narazaka/opal-file.

License

This is released under MIT License