Bonzo is a library-agnostic, extensible DOM manipulation utility designed to be minimalist and work with or without a host library like Ender.js. It provides a chainable API for common DOM tasks such as adding/removing classes, manipulating CSS, appending/prepending elements, and iterating over collections. Version 2.0.0, published in 2012, is the latest release and the package has been largely unmaintained since then. It differentiates itself from larger libraries like jQuery by focusing solely on DOM manipulation and explicitly requiring integration with external selector engines (e.g., Qwery) for CSS-style selections, rather than including one internally. Its release cadence was irregular, and it is now considered abandoned.
npm install bonzoVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic DOM manipulation using Bonzo's chainable API, including class manipulation, CSS styling, element insertion, and extending Bonzo with a custom method. It shows how to work with elements directly as Bonzo does not include a selector engine.
Use CommonJS 'require()' for Node.js environments or ensure the script is loaded globally in browsers. Consider using a modern DOM library if ES Modules are required.
Implement a wrapper function, e.g., `function $(selector) { return bonzo(qwery(selector)); }`, or obtain DOM elements via `document.getElementById`, `document.querySelectorAll`, etc., before passing them to bonzo().For new projects, consider modern, actively maintained DOM manipulation libraries or use native DOM APIs. For existing projects, be aware of potential risks and thoroughly test cross-browser compatibility.
If you have an HTML string, you can either create elements first (e.g., `document.createElement('div')`) or use methods like `.append()` which accept HTML strings to add content to existing elements.Ensure `bonzo.js` is included in your HTML `<head>` or `<body>` tag before your scripts, or use `const bonzo = require('bonzo');` in a CommonJS environment.Verify that your `$` function returns `bonzo(selectorEngine(selector))` and that `bonzo` itself is correctly loaded and accessible. Ensure you are passing actual DOM elements to `bonzo()` if not using a selector wrapper.
No dependency data recorded yet.