https://github.com/narazaka/opal-file
native File.read, File.write etc... for Opal
https://github.com/narazaka/opal-file
dir file filesystem opal ruby
Last synced: 11 months ago
JSON representation
native File.read, File.write etc... for Opal
- Host: GitHub
- URL: https://github.com/narazaka/opal-file
- Owner: Narazaka
- Created: 2017-10-28T04:32:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-05T11:58:50.000Z (over 6 years ago)
- Last Synced: 2025-04-12T17:00:05.690Z (about 1 year ago)
- Topics: dir, file, filesystem, opal, ruby
- Language: Ruby
- Size: 11.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this 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:
```ruby
gem 'opal-file'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install opal-file
## Usage
write foo.rb
```ruby
require "opal-file"
puts File.read("./foo")
```
and compile
```bash
opal --gem opal-file foo.rb > foo.js
```
and run!
```bash
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](https://narazaka.net/license/MIT?2017)