Giter VIP home page Giter VIP logo

mut.js's Introduction

mut.js

(myo͞ot) Minimal Ubiquitous Toolbox - A collection of tiny, useful JavaScript functions & shortcuts.

mut.qs(queryString, el)
same as el.querySelector(queryString)

mut.qsa(queryString, el)
same as el.querySelectorAll(queryString)

mut.ce(type, contents)
same as el = document.createElement(type), but adds text node with contents.

mut.post(msg, isInline = false)
like console.log but in the document body

mut.getParam(key)
get a value from the query string

mut.checkAttr(el, attr)
post() useful information about an attribute on an element

TODO:

  • Things to add:
    • mut.redy(callback): shortcut for DOMContentLoaded event
    • mut.lisn([delegate], el, callback, [options]): add event listener
    • mut.txt(el, content): Append a text node to el with the given text content.
    • mut.ap(child, parent) append child to parent element.
    • mut.pp(child, parent) prepend child to parent element.
    • mut.type(thing) like typeof, but better.
    • mut.loop([start], end, [increment], callback): easier for loop, incl _.times()
      • mut.loop(1, 8, (index) => {...}) start at 1, end at 7.
      • mut.loop(5, (index) => {...}) repeat 5 times (start at 0, end at 4)
      • mut.loop(4, 60, 4, (index) => {...}) start at 4, increment by 4, end before 60 (so, 56)

mut.js's People

Contributors

mhairston avatar

Watchers

 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.