New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mini-coffeecup

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

mini-coffeecup

Minimalist CoffeeCup.js

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
16
166.67%
Maintainers
1
Weekly downloads
 
Created
Source

Why MiniCoffeeCup? Ú³ υ³

  • ~23% faster than the official library compiling from markup to html on chrome/v8
  • 50+% smaller file with less lines and even less minified or gzipped
  • NO dependencies

Inspired by coffeecup, and ck, and mini-handlebars libraries.

NOTICE:

As I was developing mini-coffeecup, I had a better idea which became coffee-templates. I will still keep mini-coffeecup around for posterity, but no new features are likely to be added.

Quick Example

# this line is only required within node
MiniCoffeeCup = require 'mini-coffeecup'

# initialize new engine
coffeecup = new MiniCoffeeCup format: true

# provide template expression
template = (data) ->
  doctype 5
  html ->
    head ->
      title @title
    body ->
      p 'Hello, {{name}}!'
      p 'Here are your Christmas lists ({{santa_laugh}}):'
      table ->
        thead ->
          tr ->
            block 'each children, name', ->
              th '{{name}}'
        tbody ->
          tr ->
            block 'each children, name', ->
              td ->
                block 'each list', ->
                  ul ->
                    li '{{this}}'

# for example
locals =
  title: 'Christmas List'

# render coffeecup template to html
console.log coffeecup.render template, locals

As usual, for the latest examples, review the easy-to-follow ./test/test.coffee.

Or try it immediately in your browser with codepen.

TODO

  • support inline stylus?

Keywords

coffeecup

FAQs

Package last updated on 25 Dec 2012

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