Narnia's Psychedelic Mushrooms
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


0.4.20 • Public • Published

µ - Microbe - 0.4.20

Microbe build status Slack Status

(for modern browsers and ie10+)

microbe is a javascript library to aid in DOM manipulation as well as facilitating events, object observation, and data binding. It uses the micro character ( µ ) that is accessible in:

  • osx: alt + m
  • windows: alt + 0181
  • linux: alt gr + m or alt + 230

microbe aims to be modular and expandable. It’s separated into several modules:

  • Selector engine with CSS4 selector support and base functions (find, filter, siblings, children, … )

  • Core helpers (class, extend, text, attributes … )

  • DOM helpers (append, appendTo, insertAfter, prepend … )

  • Type helpers(isUnidentified, isArray, isWindow, … )

  • HTTP helpers making use of Promises (get, post, … )

  • Object.observe watches objects for changes. It can also watch itself for changes in element get/set data

  • Events - binding and emitting custom events

  • See the full list in the docs

microbes are always array-like for consistency and can be extended and merged very easily.

Don’t hesitate to file issues and features requests! Or change things yourself and send a pull request.


  • npm i -S microbejs


  • bower install -S microbejs


  • <script src="./microbe.js"></script>

Example use

// all divs on the page
var µDivs = µ( 'div' ) ;
// create a div with the class example--class
var newDiv = µ( '<div.example--class>' );
// all divs get a newDiv or a clone of newDiv inserted into the DOM after them
µDivs.insertAfter( newDiv );
// watches the class of each div
µDivs.observe( 'class', function( e )
    console.log( 'your class changed' );
} );
// gives the class example--class to each div also triggers the observe fuctions
µDivs.addClass( 'example--class' );
// sets a custom event watch
µDivs.on( 'toTheMoon', function( e )
    console.log( e.detail );
} );
// emits a custom event to all elements in µDivs with a custom data packet.
// triggers the event listener to show the sent data
µDivs.emit( 'toTheMoon', { moon : 'close' } );

Dev Installation

  • Clone repo
  • Make sure node and npm is installed
  • npm install
  • npm build

Running the tests

From the command line:

npm run test

From the browser

Available npm scripts

  • build builds all 3 standard microbe versions, then builds and runs tests
  • buildTests builds the tests
  • deploy bumps the minor version, runs build, then builds docs
  • docs builds the docs. rebuilds the docs everytime a file changes
  • docsOnce build docs once
  • gulp builds microbe
  • microbe builds microbe
  • selectorEngine builds the microbe selector engine
  • toolkit builds microbe toolkit
  • test runs the test suite in nightmare


We gladly accept and review any pull-requests. Feel free! ❤️

Otherwise, if you just want to talk, we are very easy to get a hold of!

This project adheres to the Contributor Covenant. By participating, you are expected to honor this code.

Microbe - Code of Conduct

Need to report something?

Change log


  • fixed toolkit getter issue


  • added bower to version_bump
  • removed cdnjs-importer from dependencies
  • small www changes


  • automated version bumps to stop needing to jump multiple minor versions
  • tweaked test css
  • readme updates
  • removed watch script from package.json


  • fixed global constructor leak with pseudo


  • text() : changed innetText to textContent to avoid reflow
  • added .height() and .width() syntactic sugar
  • added .scroll()
  • pageStyles split from main root tools
  • added top and left to scroll(), position(), and offset()
  • fixed local-link
  • fixed Win 10 IE 11 and Edge :lang


  • css now accepts objects
  • truncated older chanes log outto a seperate file
  • gulpfile changes
  • added position
  • added offset
  • added isMicrobe
  • made isMicrobe, version, and type read-only
  • added includes


  • added travis-ci testing
  • added nightmare command line testing
  • removed gitter


  • added appendTo and prependTo
  • aliased each to forEach for array compatability
  • added slack community to readme and www


  • children, childrenFlat, siblings, siblingsFlat now all accept filter strings
  • changes to siblings, siblingsFlat, filter, and find using + and ~


  • selectorEngine now accepts functions as "document ready" short hand


  • added bower support
  • µ.ready now accepts an arguments array
  • added examples to docs
  • updated code of conduct
  • toggleClass now accepts an array of classes
  • twitter account added to info

Older Changes

To keep the length of this file down, older changes are here


npm i microbejs

Downloadsweekly downloads









last publish


  • avatar
  • avatar