Socket
Book a DemoInstallSign in
Socket

halojs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

halojs

HaloJS is a simple but powerful templating language that allows you to generate HTML markup in a Javascript manner.

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

About HaloJS

HaloJS is a simple but powerful templating language that allows you to generate HTML markup in a Javascript manner.

Installation

$ npm install --save halojs

Features

  • Create HTML markup with Javascript syntax
  • Fast compilation
  • Multiline support
  • Support for partials & layouts

Examples

const halo = require('halojs');
// Renders a string
let compiled = halo.render(string, params);
// Renders a file
let compiled = halo.renderFile(filePath, params);

Syntax

Creating a form:

@form.upload('/contact', { novalidate: true, autocomplete: true });
    <div class="form-group">
        @ input.text
        (
            'name', 
            { 
                class: 'input form-control', 
                'data-validation': 'required', 
                'data-validation-error-msg': 'Please enter your full name', 
                placeholder: 'Your Name *'
            }
        );
    </div>
    <div class="form-group">
        <div class="row">
            <div class="col-sm-6">
                @ input.email('email', 
                    { 
                        class: 'input form-control', 
                        'data-validation': 'required', 
                        'data-validation-error-msg': 'Please enter your email address',
                            placeholder: 'Email Adress *' 
                    }
                );
            </div>
            <div class="col-sm-6">
                @ input.tel('phone', 
                    { 
                        class: 'input form-control', 
                        'data-validation': 'required', 
                        'data-validation-error-msg': 'Please enter your phone number', 
                        placeholder: 'Phone Number *'
                    }
                );
            </div>
        </div>
    </div>
    <div class="form-group">
        @ textarea('message', 
            { 
                class: 'input form-control', 
                'data-validation': 'required', 
                'data-validation-error-msg': 'Please leave a message', 
                placeholder: 'Your Message *', 
                rows: 3 
            }
        );
    </div>
    @ button.submit('Submit', { class: 'btn btn-block ui-gradient-green shadow-md' });
@endform;

Docs

https://halojs.com

License

HaloJS is released under the MIT license.

Keywords

template

FAQs

Package last updated on 08 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.