
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
buddy-system
Advanced tools
Avoids single words breaking onto the last line of text.
npm install buddy-system
var $ = require('jquery');
require('buddy-system')($); <----- Attaches itself to the jquery object
Use dist/buddysystem.js and simply pass in an array of objects into buddySystem()
objs = document.getElementsByClassName('corrected')
buddySystem(objs)
Use dist/buddysystem.jquery.js after jQuery and $.buddySystem() on any element or elements.
$('.corrected').buddySystem()
Because you don't need yet another library in your app to do something so simple, this code snippet has been golfed to be as small as possible.
BuddySystem looks for the last space in a phrase like this one
The rain in Spain falls mainly on the plains
And replaces it with
, causing the last two words to be parsed as one...holding hands together, the buddy system.
The rain in Spain falls mainly on the plains
Of course, because
is unicode markup for a non-breaking space, the text will appear as:
"The rain in Spain falls mainly on
the plains"
If the line breaks after the last "the".
git clone https://github.com/olsonpm/buddy-system.git
cd buddy-system
npm install
make test
// dev your heart out
FAQs
Prevent single words from breaking to a new line.
The npm package buddy-system receives a total of 0 weekly downloads. As such, buddy-system popularity was classified as not popular.
We found that buddy-system demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.