Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binocarlos/mercury-jsx-folder
Convert a folder of .jsx files into standard .js files
https://github.com/binocarlos/mercury-jsx-folder
Last synced: 11 days ago
JSON representation
Convert a folder of .jsx files into standard .js files
- Host: GitHub
- URL: https://github.com/binocarlos/mercury-jsx-folder
- Owner: binocarlos
- License: mit
- Created: 2014-10-30T07:32:11.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-30T07:54:08.000Z (about 10 years ago)
- Last Synced: 2024-10-31T17:12:12.957Z (20 days ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mercury-jsx-folder
==================Convert a folder of .jsx files into standard .js files - uses [mercury-jsx](https://github.com/Raynos/mercury-jsx)
[![Travis](http://img.shields.io/travis/binocarlos/mercury-jsx-folder.svg?style=flat)](https://travis-ci.org/binocarlos/mercury-jsx-folder)
## install
```
$ npm install mercury-jsx-folder
```## usage
```js
var processFolder = require('mercury-jsx-folder')var processor = processFolder({
source:__dirname + '/fixtures/src',
dest:__dirname + '/fixtures/build'
})processor.on('file', function(source, target){
console.log('processing: ' + path)
})processor.run(function(err){
console.log('all .jsx have been processed into .js')
})
```The above example will load all `.jsx` files from `__dirname + '/fixtures/src'` and pipe them via a `mercury-jsx`.
The results of each file will be written to `__dirname + '/fixtures/build'` with the .jsx suffix replaced with .js
## cli
To use as a command line application:
```
$ mercury-jsx-folder -i fixtures/src -o fixtures/build
```## license
MIT