document-make
v2.0.2
Published
The tool for making DOM elements quickly
Readme
dm
document-make
A collection of typed functions to create elements with attributes and children
Installation
npm i document-makeUsage
import * as dm from 'document-make'
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 hr = dm.hr() // makes an hr element
const div = dm.div({}, label, input, hr, 'Great choice!') // makes a div containing the previous elements and textEditing
If you fork this, you should make your changes to builder.mjs and run npm run build to regenerate index.js
It is recommended to install es6-string-html if you are going to edit the source code
To-do
- Add test to check formatting of generated code
