Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/batosai/fractal-edge-adapter


https://github.com/batosai/fractal-edge-adapter

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# edge Adapter

Use [edge](https://github.com/edge-js/edge) templates with [Fractal](http://github.com/frctl/fractal).

## Usage

Install via NPM:

```bash
npm i @jrmc/fractal-edge-adapter --save
```

Then configure your Fractal instance:

```js
fractal.components.set('ext', '.edge'); // look for files with a .edge file extension
fractal.components.set('edge.components.prefix', 'prefix')); // option: mount components in prefix, sample : @!prefix.button()
fractal.components.set('edge.components.path', path.join(__dirname, 'views')); // option: add specific path for edge components
fractal.components.set('edge.helpers', {
hello: () => 'world',
}); // option: specify helpers
fractal.components.engine('@jrmc/fractal-edge-adapter'); // register the edge engine adapter for your components
```