Coder Social home page Coder Social logo

ermi111 / browserutility Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 227 KB

Browser Utility, offering a streamlined set of utility classes across four modules: DOM, Form, Network, and Media and Device. These utilities simplify common web development tasks, replacing the deprecated Awedde package with improved functionality, reduced redundancy, and enhanced code quality.

Home Page: https://www.jsdelivr.com/package/npm/butility

License: MIT License

JavaScript 100.00%
browser capture classes-and-objects device device-detection dom dommanipulation file form media network utility validation hardware-on-browser

browserutility's Introduction

Butility

Butility is a handy JavaScript package designed to simplify common tasks in web apps. It’s packed with useful methods for dealing with the DOM, devices, media, networks, and forms. Butility is made for the browser, so it’s all about making your web development easier and more efficient.

Installation

Just add Butility to your project:

npm install butility

Or include it directly in your HTML:

<script src="path/to/butility.js" type="module"></script>

CDN

You can include Butility directly in your HTML using various CDNs:

<!-- JSDelivr -->
<script src="https://cdn.jsdelivr.net/npm/butility@latest/butility.min.js" type="module"></script>

<!-- UNPKG -->
<script src="https://unpkg.com/butility@latest/butility.js" type="module"></script>

ZIP file download

To download the files directly, Click here and get the zip file.

Usage

Using Butility is straightforward. Here’s a quick example with esm:

// Use ESM version
import { Element, Validate } from "./butility.js";

const emailInput = Element.createElement({  // Using the dom Element method
    name: 'input',
    class: ['input', 'input-form'],
    attr: {
        id: 'email',
        type: 'email',
        name: 'email',
        required: true,
        placeholder: 'Email',
    },
}, e => {
    e.addEventListener('change', () => {
        if (Validate.validateEmailAddress(e.value)) {
            console.log("Email: pass!");
        } else {
            console.log("Enter correct email pls!");
        } // Using form Validate method
    });
});

Element.appendElement(document.body, emailInput);

and in html:

<!-- Use standard version -->
<script src="./butility.js"></script>
<script>
    import { Utility } from "./butility.js"
    const button = document.querySelector('button');
    Utility.addClasses(button, 'you-first-class','second-class' /* continue as your need!*/);
</script>

Each module is packed with helpful methods that make your web development life easier.

API Documentation

Check out the API documentation on the GitHub Wiki.

License

MIT License. Ermiyas

browserutility's People

Contributors

ermi111 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.