5.1.2 • Published 19 hours ago

@ruby2js/ruby2js v5.1.2

Weekly downloads
42
License
MIT
Repository
github
Last release
19 hours ago

@ruby2js/ruby2js

npm node

Ruby2JS is an extensible Ruby to modern JavaScript transpiler.

Example usage

import { Ruby2JS } from '@ruby2js/ruby2js';

console.log(
  Ruby2JS.convert(
    '"2A".to_i(16)',
    {filters: ['functions']}
  ).toString()
)

An example of all supported options:

{
  autoexports: true,
  autoimports: {"[:LitElement]": "lit-element"},
  comparison: "identity",
  defs: {A: ["x", "@y"]},
  eslevel: 2021,
  exclude: ["each"],
  filters: ["functions"],
  include: ["class"],
  include_all: true,
  include_only: ["max"],
  import_from_skypack: true,
  or: "nullish",
  require_recurse: true,
  strict: true,
  template_literal_tags: ["color"],
  underscored_private: true,
  width: 40
}

Documentation

  • Visit ruby2js.com for detailed instructions and examples.
  • Read the main monorepo CHANGELOG for information on what's new in this package.

Testing

git clone https://github.com/ruby2js/ruby2js.git
cd ruby2js/packages/ruby2js
bundle install
yarn install
yarn build
yarn test

Contributing

  1. Fork it (https://github.com/ruby2js/ruby2js/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

MIT

5.1.2

19 hours ago

5.1.1

4 months ago

5.1.0

1 year ago

5.0.1

2 years ago

5.0.0

2 years ago

0.2.1

2 years ago

0.2.0

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago