https://github.com/knowbee/rona
Convert require syntax to ES6 import syntax
https://github.com/knowbee/rona
convert-to-es6 es6 import require require-to-import requiretoimport transform
Last synced: 3 months ago
JSON representation
Convert require syntax to ES6 import syntax
- Host: GitHub
- URL: https://github.com/knowbee/rona
- Owner: knowbee
- Created: 2020-03-19T16:36:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T05:07:50.000Z (about 5 years ago)
- Last Synced: 2025-07-07T01:44:09.465Z (10 months ago)
- Topics: convert-to-es6, es6, import, require, require-to-import, requiretoimport, transform
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/rona
- Size: 79.1 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# rona
[](https://travis-ci.com/knowbee/rona)
[](https://www.npmjs.com/package/rona)
[](https://github.com/ellerbrock/open-source-badge/)
[](https://github.com/ellerbrock/open-source-badge/)
convert require syntax to ES6 import syntax
## Supported conversions
```js
const something = require("example"); // => import something from "example";
const Ben = require("person").name; // => import { name as Ben } from "person";
const { something } = require("things"); // => import { something } from "things";
const { something, anotherThing } = require("things"); // => import { something, anotherThing } from "things";
const something = require("things")(); // => import something from "things";
require("things"); // => import "things";
require("../things"); // => import "../things";
const something = require("things").something(); // => import { something } from "things";
const { thing, thingy: anotherThing } = require("module"); // => import { thing, thingy as anotherThing} from "module"
const {
thing,
anotherThing,
widget: renamedWidget,
shape: anotherShape,
color,
} = require("module"); // => import { thing, anotherThing, widget as renamedWidget, shape as anotherShape, color } from "module";
```
## Installation
```
npm install -g rona
```
```
yarn global add rona
```
## Usage
::
Usage: rona [options]
rona is a tool that converts your project require syntax to ES6 import syntax as it should be
Options:
--version, -V output the version number
--path, -p provide a path to run rona
-h, --help output usage information
Example:
rona --path ./src
## Contribution
- Please before making a PR, read first this [Contributing Guideline](./CONTRIBUTING.md)
## License
MIT
## Author
Igwaneza Bruce