Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
/ edge-supercharged Public archive

Supercharge your edge components and use them as tags

License

Notifications You must be signed in to change notification settings

edge-js/edge-supercharged

Repository files navigation

Table of contents

Edge Supercharged

Supercharge your components and use them as edge tags

gh-workflow-image typescript-image npm-image license-image synk-image

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

npm i edge-supercharged

# yarn
yarn add edge-supercharged

And use it as follows

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'
})

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.

Creating components

The components must live inside the ./components directory relative to the views directory and then you can reference your components as tags.

Instead of using the component as follows

@component('button', { type: 'submit' })
  <span> Submit form </span>
@end

You can use it as follows:

@button({ type: 'submit' })
  <span> Submit form </span>
@end

About

Supercharge your edge components and use them as tags

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages