https://github.com/jchavarri/genbindings
Babel plugin to auto-generate Reason bindings from JavaScript+Flow annotated code.
https://github.com/jchavarri/genbindings
Last synced: 3 months ago
JSON representation
Babel plugin to auto-generate Reason bindings from JavaScript+Flow annotated code.
- Host: GitHub
- URL: https://github.com/jchavarri/genbindings
- Owner: jchavarri
- License: mit
- Created: 2018-10-07T18:29:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T22:48:25.000Z (over 6 years ago)
- Last Synced: 2025-02-28T06:04:27.338Z (4 months ago)
- Language: OCaml
- Size: 118 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# genBindings
Babel plugin to generate Reason bindings based on exported values with the `// @genBindings` annotation.
:warning: Status: Early alpha. Only a few happy paths work at the moment. :warning:
## Requirements
The plugin can be used in projects that are configured with:
- Babel 6
- Flow 0.82Flow binary (`flow`) is expected to be available in `node_modules/.bin/flow` (no customization via config yet).
## Installation
```sh
$ npm install --save-dev jchavarri/genBindings
```Add `genBindings` to `.babelrc`.
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["genBindings"]
}
```### Via CLI
```sh
$ babel --plugins genBindings script.js
```### Via Node API
```javascript
require('babel').transform('code', {
plugins: ['genBindings']
});
```