Socket
Socket
Sign inDemoInstall

h3

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h3 - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

12

package.json
{
"name": "h3",
"version": "1.0.0",
"description": "A better HTMLElement constructor",
"homepage": "https://github.com/twhb/h3-js",
"bugs": "https://github.com/twhb/h3-js/issues",
"license": "ISC",
"author": "Tristan Berger <tristanberger@gmail.com>",
"repository": {
"type": "git",
"url": "https://github.com/twhb/h3-js.git"
}
"version": "2.0.0",
"description": "DEPRECATED"
}

@@ -1,38 +0,1 @@

# h3-js
A better HTMLElement constructor
## Example
```javascript
var body = h('div', 'example',
h('h1', null, 'Example'),
h('label', {htmlFor: 'task'},
h('input', {id: 'task', type: 'checkbox', checked: true}),
'Check out h3-js'
)
);
```
## API
### h(tagName, props, ...children)
Creates and returns a new HTMLElement.
Primary interface: `tagName` sets the tag name, each key-value pair of `props` is copied onto the result, and each of `children` is appended to the result.
Conveniences:
- `props.style` sets `result.style.cssText`
- If `props` is falsy then it is ignored
- If `props` is a string then it instead sets `result.className`
- Children that are falsy are ignored
- Children that are strings are converted to `Text` instances
- Children that are Arrays are flattened into `children`
## Setup
Install: `npm install h3`
Import: `const h = require('h3');`
DEPRECATED
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