document-make

1.0.5 • Public • Published

document-make

The tool for making DOM elements quickly.

Description

  • This is currently under development
  • The dm function gives you a concise way of programmatically making DOM elements with attributes and children.

Installation

npm install document-make -g

Usage

import dm from 'document-make'

const hr = dm('hr')  // makes an hr element
const label = dm('label', {for: 'file-input'}, 'Choose a cool picture: ')  // makes a label with text
const input = dm('input', {type: 'file', id: 'file-input', name: 'file-input', accept: 'image/png'})  // makes a file input with an id and name
const div = dm('div', {}, label, input, hr, 'Great choice!')  // makes a div containing the previous elements and text

To-do

  • Switch to Typescript

Readme

Keywords

Package Sidebar

Install

npm i document-make

Weekly Downloads

7

Version

1.0.5

License

ISC

Unpacked Size

2.41 kB

Total Files

4

Last publish

Collaborators

  • jankrum