edge-supercharged
TypeScript icon, indicating that this package has built-in type declarations

3.1.1 • Public • Published

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

Learn more ➞

/edge-supercharged/

    Package Sidebar

    Install

    npm i edge-supercharged

    Weekly Downloads

    11,837

    Version

    3.1.1

    License

    MIT

    Unpacked Size

    12.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • virk
    • julien-r44