Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

el-component

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

el-component - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.travis.yml

2

component.json

@@ -5,3 +5,3 @@ {

"description": "creates HTML from jade like expressions",
"version": "0.1.0",
"version": "0.1.1",
"keywords": [],

@@ -8,0 +8,0 @@ "dependencies": {},

0.1.1 / 2014-03-10
==================
* fix repo references in package.json
* add Readme badges
* add travis CI config
* update docs
0.1.0 / 2013-12-15

@@ -3,0 +11,0 @@ ==================

{
"name": "el-component",
"version": "0.1.0",
"version": "0.1.1",
"description": "create HTML from jade-like expressions",

@@ -11,3 +11,3 @@ "main": "index.js",

"type": "git",
"url": "https://github.com/code42day/el-component.git"
"url": "https://github.com/code42day/el.git"
},

@@ -24,3 +24,3 @@ "keywords": [

"bugs": {
"url": "https://github.com/code42day/el-component/issues"
"url": "https://github.com/code42day/el/issues"
},

@@ -32,2 +32,2 @@ "devDependencies": {

}
}
}

@@ -0,6 +1,12 @@

[![Build Status](https://img.shields.io/travis/code42day/el.svg)](http://travis-ci.org/code42day/el)
[![Dependency Status](https://img.shields.io/gemnasium/code42day/el.svg)](https://gemnasium.com/code42day/el)
[![NPM version](https://img.shields.io/npm/v/el-component.svg)](http://badge.fury.io/js/el-component)
# el
creates HTML from jade like expressions
creates HTML from jade like expressions
Particularly useful if you are a fan of [`insertAdjacentHTML`][1] but if setting `innerHTML` is your
thing `el` works just as well.
## Installation

@@ -14,6 +20,31 @@

### el(tag, content, attributes)
- `tag` - can be the name of HTML tag (`span`, `img` etc.) or a jade-like expression
- `content` - is an optional content of the tag
- `attributes` - object with a map of attributes added to the generated HTML, class attribute is
merged with what was parsed from tag
Some examples:
el('span', 'some text inside'); // <span>some text inside</span>
el('span.title', 'Title'); // <span class="title">Title</span>
el('span.title.car', 'Title'); // <span class="title car">Title</span>
el('span#title.car', 'Title'); // <span class="car" id="title">Title</span>
you can skip the tag name if you want `div`:
el('#title', 'Title'); // <div id="title">Title</div>
el(); // <div></div>
el knows about void elements:
el('img', { src: 'http://example.com/img.png' }); // <img src="http://example.com/img.png">
el('iframe', { src: 'http://example.com' }); // <iframe src="http://example.com"></iframe>
## License
MIT
[1]: https://developer.mozilla.org/en-US/docs/Web/API/Element.insertAdjacentHTML
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