https://github.com/shuhei/babel-plugin-type-assertion
An experimental babel transformer plugin for rtts_assert
https://github.com/shuhei/babel-plugin-type-assertion
Last synced: 8 months ago
JSON representation
An experimental babel transformer plugin for rtts_assert
- Host: GitHub
- URL: https://github.com/shuhei/babel-plugin-type-assertion
- Owner: shuhei
- Created: 2015-04-23T15:48:57.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-01T15:30:24.000Z (about 10 years ago)
- Last Synced: 2025-03-08T07:37:38.962Z (9 months ago)
- Language: JavaScript
- Size: 218 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- angular-awesome-list - babel-plugin-type-assertion
README
# babel-plugin-type-assertion
An babel transformer plugin for [rtts_assert](https://www.npmjs.com/package/rtts_assert), a run-time type assertion library for JavaScript.
- Inject runtime type assertions based on flow types.
- Can be turned off on production build. (Just exclude from babel's `plugins` option.)
## Installation
```
npm install -S rtts_assert babel-core babel-plugin-type-assertion
```
## Usage
You need to transpile also rtts_assert's ES6 code.
Require hook:
```
require('babel-core/register')({
ignore: /node_modules\/(?!rtts_assert)/,
plugins: ['type-assertion']
});
require('your-module');
```
Webpack:
[Working example config file](https://github.com/shuhei/accbook/blob/master/webpack.config.js)