🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

bowtie-js

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bowtie-js

Yet another template engine

latest
Source
npmnpm
Version
0.0.15
Version published
Maintainers
1
Created
Source

Bowtie

Build Status Coverage Status

Expressive template engine for Node.js heavily inspired by Jade.

Goals

This project aims to develop an expressive template language to write html documents using the dry and kiss principles. And of course, remove the pain of writing angle brackets.

Current status

This project is currently in it's pre-alpha stage. Current features:

  • Basic html output
  • Loops
  • If-Else
  • Mixins
  • Extending
  • Importing
  • Variables

Installation

$ npm install bowtie-js
Syntax highlighting

Syntax highlighting and auto completion is available for Atom editor. Syntax highlighting is triggered on .bow-files.

Install:

$ apm install atom-language-bowtie

Usage

With Gulp

Gulp compatible compiling comes out of the box with Bowtie, example:

var gulp = require('gulp');
var bowtie = require('bowtie-js').gulp;

gulp.task('bowtie', function() {
  return gulp.src('*.bow')
    .pipe(bowtie({
      // Pretty output
      "pretty": true,
      // Object to pass to template engine
      "locals": {
        "title": "Example application"
      }
    }))
    .pipe(gulp.dest('./dist'));
});

Example

!doctype("html")
html {
  head {
    title: $title
  }
  body {
    div.className {
      h1: "Example"
      p: "Hello world!"
    }
  }
}

The example above outputs:

<html>
    <head>
        <title>Example application</title>
    </head>
    <body>
        <div class="className">
            <h1>Example</h1>
            <p>Hello world!</p>
        </div>
    </body>
</html>

License

The MIT License

Keywords

Template

FAQs

Package last updated on 16 Oct 2016

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