Socket
Socket
Sign inDemoInstall

coffeex

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

coffeex

Coffee DSL for React Virtual DOM instead of JSX


Version published
Maintainers
1
Created
Source

CoffeeX

Coffee DSL for React Virtual DOM instead of JSX

This is inspired by coffeekup and vk

Usage

In JavaScript

React.createElement('div', {}, [
  React.createElement('h1', { style: { textAlign: 'center' } }, [
    React.createElement('span', {}, [
      'text',
      React.createElement('br'),
      'text',
      React.createElement('br'),
      'text',
      React.createElement('br')
    ])
  ]),
  React.createElement('h2', {}, [
    'text1',
    React.createElement('br'),
    'text2'
  ])
]);

In CoffeeX:

cfx ($, _) ->
  $.div ->
    $.h1 style: { textAlign: 'center' }, ->
      $.span ->
        for i in [1..3]
          _ 'text'
          $.br
    $.h2 ->
      _ 'text1'
      $.br
      _ 'text2'

API

cfx: Function

cfx(block: Function($, _))

$: Function

Example:

$ 'div', '#main.container', { style: { width: '960px' } }, ->
  # children...

Arguments Pattern:

tag name (String)
/ component (ReactComponent)
id and class
(CSSSelectorString)
attribute
(Object)
children
(Function / String)

FAQs

Package last updated on 06 May 2015

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc