Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

Commit 873a32d

Browse files
committed
docs(README): add usage docs
1 parent d6bff68 commit 873a32d

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div align="center"><img src="https://res.cloudinary.com/adonis-js/image/upload/q_100/v1600679850/edge-banner_wao6ex.png" width="600px"></div>
1+
<div align="center"><img src="https://res.cloudinary.com/adonis-js/image/upload/v1620150474/edge-banner_tzmnox.jpg" width="600px"></div>
22

33
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
44
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -10,13 +10,33 @@
1010
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1111

1212
# Edge Supercharged
13-
1413
> Supercharge your components and use them as edge tags
1514
16-
[![appveyor-image]][appveyor-url] [![circleci-image]][circleci-url] [![npm-image]][npm-url] ![](https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript) [![synk-image]][synk-url]
15+
[![circleci-image]][circleci-url] [![appveyor-image]][appveyor-url] [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url] [![synk-image]][synk-url]
16+
17+
Edge supercharged enables you to use your components as edge tags. It began by scanning all the templates stored inside the `./components` directory of your view root and make them available as tags.
18+
19+
## Usage
20+
Install the package from npm registry as follows
21+
22+
```sh
23+
npm i edge-supercharged
24+
25+
# yarn
26+
yarn add edge-supercharged
27+
```
28+
29+
And use it as follows
30+
31+
```ts
32+
const edge = require('edge.js').default
33+
const { Supercharged } = require('edge-supercharged')
34+
35+
const supercharged = new Supercharged()
36+
edge.use(supercharged.wire, { recurring: process.env.NODE_ENV === 'development' })
37+
```
1738

18-
## Maintainers
19-
[Harminder virk](https://github.com/thetutlage)
39+
During development, you must set the `recurring` option to true, so that edge reapplies the plugin on each render call. This will allow `edge-supercharged` to re-discover the components from the filesystem.
2040

2141
[appveyor-image]: https://img.shields.io/appveyor/ci/thetutlage/edge-supercharged/master.svg?style=for-the-badge&logo=appveyor
2242
[appveyor-url]: https://ci.appveyor.com/project/thetutlage/edge-supercharged "appveyor"

0 commit comments

Comments
 (0)