1 | # rosid-handler-js
|
2 |
|
3 | [![Travis Build Status](https://travis-ci.org/electerious/rosid-handler-js.svg?branch=master)](https://travis-ci.org/electerious/rosid-handler-js) [![Coverage Status](https://coveralls.io/repos/github/electerious/rosid-handler-js/badge.svg?branch=master)](https://coveralls.io/github/electerious/rosid-handler-js?branch=master) [![Dependencies](https://david-dm.org/electerious/rosid-handler-js.svg)](https://david-dm.org/electerious/rosid-handler-js#info=dependencies)
|
4 |
|
5 | A function that loads a JS-file and transforms, bundles and compresses its content.
|
6 |
|
7 | ## Install
|
8 |
|
9 | ```
|
10 | npm install rosid-handler-js
|
11 | ```
|
12 |
|
13 | ## Usage
|
14 |
|
15 | ```js
|
16 | const js = require('rosid-handler-js')
|
17 |
|
18 | js('/src/main.js', '/src', '/dist', {}).then(({ data, savePath }) => {})
|
19 | ```
|
20 |
|
21 | ## Parameters
|
22 |
|
23 | - `filePath` `{String}` Absolute path to the requested file.
|
24 | - `srcPath` `{String}` Absolute path to the source folder.
|
25 | - `distPath` `{?String}` Absolute path to the export folder.
|
26 | - `route` `{Object}` The route which matched the request URL.
|
27 |
|
28 | ## Returns
|
29 |
|
30 | - `{Promise}({Object})`
|
31 | - `data` `{String | Buffer}` The transformed file content.
|
32 | - `savePath` `{?String}` Where to save the file when compiling. |
\ | No newline at end of file |