From 873a32df31e47d57d982f27120072658a8201afd Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Wed, 5 May 2021 01:03:48 +0530 Subject: [PATCH] docs(README): add usage docs --- README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f852dd4..b9aa387 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -
+
@@ -10,13 +10,33 @@ # Edge Supercharged - > Supercharge your components and use them as edge tags -[![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] +[![circleci-image]][circleci-url] [![appveyor-image]][appveyor-url] [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url] [![synk-image]][synk-url] + +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. + +## Usage +Install the package from npm registry as follows + +```sh +npm i edge-supercharged + +# yarn +yarn add edge-supercharged +``` + +And use it as follows + +```ts +const edge = require('edge.js').default +const { Supercharged } = require('edge-supercharged') + +const supercharged = new Supercharged() +edge.use(supercharged.wire, { recurring: process.env.NODE_ENV === 'development' }) +``` -## Maintainers -[Harminder virk](https://github.com/thetutlage) +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. [appveyor-image]: https://img.shields.io/appveyor/ci/thetutlage/edge-supercharged/master.svg?style=for-the-badge&logo=appveyor [appveyor-url]: https://ci.appveyor.com/project/thetutlage/edge-supercharged "appveyor"