Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bredele/steroid-hook
:pill: Nodejs hook to transpile HTML templates into jsx-like templates
https://github.com/bredele/steroid-hook
es6 html jsx steroid template template-engine
Last synced: 13 days ago
JSON representation
:pill: Nodejs hook to transpile HTML templates into jsx-like templates
- Host: GitHub
- URL: https://github.com/bredele/steroid-hook
- Owner: bredele
- License: mit
- Created: 2017-04-03T22:27:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-07T01:41:51.000Z (over 7 years ago)
- Last Synced: 2024-04-14T04:03:36.791Z (9 months ago)
- Topics: es6, html, jsx, steroid, template, template-engine
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Steroid-hook
[![Build Status](https://travis-ci.org/bredele/steroid-hook.svg?branch=master)](https://travis-ci.org/bredele/steroid-hook)
[![NPM](https://img.shields.io/npm/v/steroid-hook.svg?style=flat-square)](https://www.npmjs.com/package/steroid-hook)
[![Downloads](https://img.shields.io/npm/dm/steroid-hook.svg?style=flat-square)](http://npm-stat.com/charts.html?package=steroid-hook)
[![pledge](https://bredele.github.io/contributing-guide/community-pledge.svg)](https://github.com/bredele/contributing-guide/blob/master/community.md)This module bind itself to node’s require and automatically compile files on the fly to create jsx-like templates using ES6 only and [Steroid](https://github.com/bredele/steroid).
## Usage
```js
const html = require('steroid')const component = html`
`function HelloMessage(props) {
return html`Hello ${props.name}
`
}
```When an element represents a user-defined component (a function starting with an uppercase character), it passes the defined attributes to this function as a single object as well as this element children.
## Installation
```shell
npm install steroid-hook --save
```All subsequent files required by node with the defined extension will be transformed by this module.
```js
// transpile files with the html extension
require('steroid-hook')('.html')
```[![NPM](https://nodei.co/npm/steroid-hook.png)](https://nodei.co/npm/steroid-hook/)
## Question
For questions and feedback please use our [twitter account](https://twitter.com/bredeleca). For support, bug reports and or feature requests please make sure to read our
community guideline and use the issue list of this repo and make sure it's not present yet in our reporting checklist.## Contribution
Steroid-hook is an open source project and would not exist without its community. If you want to participate please make sure to read our guideline before making a pull request. If you have any steroid-hook related project, component or other let everyone know in our wiki.
## Licence
The MIT License (MIT)
Copyright (c) 2016 Olivier Wietrich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.