
Security News
npm Introduces minimumReleaseAge and Bulk OIDC Configuration
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.
A library agnostic extensible DOM utility. Nothing else.
Bonzo is designed to live in any host library, such as Ender, or simply as a stand-alone tool for the majority of your DOM-related tasks.
It looks like this:
bonzo(elements)
.hide()
.addClass('foo')
.append('<p>the happs</p>')
.css({
color: 'red',
'background-color': 'white'
})
.show()
A great way to use Bonzo is with a selector engine, like Qwery. You could wrap Bonzo up and augment your wrapper to inherit the same methods:
function $(selector) {
return bonzo(qwery(selector));
}
This now allows you to write the following code:
$('#content a[rel~="bookmark"]').after('√').css('text-decoration', 'none');
One of the greatest parts about Bonzo is its simplicity to hook into the internal chain to create custom methods. For example you can create a method called color() like this:
bonzo.aug({
color: function (c) {
return this.css('color', c);
}
})
// you can now do the following
$('p').color('aqua')
Added in the Ender bridge
For the insertion methods you can set a query selector host:
bonzo.setQueryEngine(qwery)
bonzo(bonzo.create('<div>')).insertAfter('.boosh a')
Bonzo Madrid was a malicious battle school commander of whom eventually is killed by Ender Wiggin. Bonzo represents the DOM, of whom we'd all love to slay.
You should only edit the files in the src/ directory. Bonzo is compiled into the bonzo.js and bonzo.min.js files contained in the root directory by the build command:
$ npm install
$ make
Point your test browser(s) to tests/tests.html, or:
$ open tests/tests.html
Please try to include tests or adjustments to existing tests with all non-trivial contributions.
Bonzo is a registered npm package and fits in nicely with the Ender framework. If you don't have Ender, you should install now, and never look back, ever. As a side note the query engine host is set for you when you include it with Ender.
$ npm install ender -g
To combine Bonzo to your Ender build, you can add it as such:
$ ender build bonzo[ package-b[ package-c ...]]
or, add it to your existing ender package
$ ender add bonzo
Bonzo is included in The Jeesh, Ender's "starter-pack", when you ender build jeesh you'll get Bonzo and some other amazing libraries that'll make working in the browser a breeze. See the Ender documentation for more details.
Bonzo is Copyright © 2012 Dustin Diaz @ded and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
FAQs
Library agnostic, extensible DOM utility
The npm package bonzo receives a total of 2,293 weekly downloads. As such, bonzo popularity was classified as popular.
We found that bonzo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.

Research
/Security News
Socket uncovered four malicious NuGet packages targeting ASP.NET apps, using a typosquatted dropper and localhost proxy to steal Identity data and backdoor apps.