jsx-template-engine
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

JSX Template Engine


Build Status Coverage Status NPM version Code Size License PR's Welcome

Agnostic JSX template engine 🦄.

Features

  • 🥞   Inspired from jsx-engine.
  • 🔥   Blaze, amiable and lightweight jsx pragma.
  • 💅🏻   Based on babel-core.
  •   Agnostic solution for Node.js server side frameworks.
  • 🎉   TypeScript support.

Installation

# npm
$ npm install jsx-template-engine
# yarn
$ yarn add jsx-template-engine

Usage

This is a practical example of how to use.

import jsx from "jsx-template-engine";

(async () => {
  const htmlString = await jsx.render("export default () => <div>100</div>");
  // <div>100</div>
})();

API

importComponent(path: string): string:

a sync method to import jsx component from a file.

render/jsxEngine (code: string, payload: Props =, path?: string):

an async method to parse the the jsx code string to html string where you can pass props as payload param and a path param for used and compose files.

License


MIT © Imed Jaberi

Package Sidebar

Install

npm i jsx-template-engine

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

14.2 kB

Total Files

7

Last publish

Collaborators

  • 3imed-jaberi