Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

SuperFola/forge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

small-forge

version downloads

A small npm package to generate HTML easily.

Installing

npm i small-forge

Design goals

  • the fewest/smallest dependencies possible (I am one of those people who hate having a lot of small libs to use another bigger lib)
  • simplicity
  • use and abuse of ...args
  • documentation everywhere

Examples

const sf = require('small-forge');
const [div, h1, p, img] = sf.forgeSomeElements(
    'div', { className: 'cool-div' },
    'h1',  { textContent: 'Hello GitHub!' },
    'p',   { className: 'big-paragraph', textContent: 'A small package to generate HTML easily' },
    'img', { src: 'public/img/sf.png', alt: 'small-forge logo' }
);

sf.forgeStyle(div, {
    opacity: 1.0,
    transition: 'opacity 1s'
});

sf.forgeHierarchy(
    div, [
        h1, p, img
    ]
);