0.2.0 • Published 2 years ago

fastview v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

FastView

Fast Javascript front end templates.

This library adds extra HTML tags and attributes to speed up web development.

Made for the Waveorb Web Application Development Framework.

Install

npm i fastview

Usage

var fastview = require('fastview')
var h = fastview()

// With options, add your own components
var components = {
  image: function(str) {
    str = str.replace(/<image/g, function (tag) {
      return /* HTML */`<img loading="lazy"`
    })
    return str.trim()
  }
}
var h = fastview({ components })

Then, using the example above, write this in your HTML:

h`<image src="/image.png">`

and it's translated into this:

<img loading="lazy" src="/image.png">

Components

Check out /lib/components.js to see the built in components.

MIT Licensed. Enjoy!

0.2.0

2 years ago