fast-creator

1.6.0 • Public • Published

npm downloads downloads downloads Test

This library reduces amount of code needed to create dom (html) element #samples

import {create} from 'fast-creator';

let a = create('div.sample p#fisrt');
let b = create({tagName:'div', className:'sample', children:['p#fisrt']));
let c = create('div', {data:{thisWillBeInDataset:'abcd'}});

#list of functions

create(selector, attributes, document)

Generates and returns new element. You can define an element on two ways:

  • selector string - css-like selector
  • attributes object

In this example all three elemens will be identical:

import {create} from 'fast-creator';

let a = create('p#first.red');
let b = create({tagname:'p',id:'first',className:'red'});
let c = create('p',{id:'first',className:'red'});

Readme

Keywords

none

Package Sidebar

Install

npm i fast-creator

Weekly Downloads

24

Version

1.6.0

License

MIT

Unpacked Size

22.6 kB

Total Files

14

Last publish

Collaborators

  • matrix0123456789