Today's JavaScript developers need fewer well-designed, battle-tested, comprehensive JavaScript toolkits and more one-off, disconnected, and gratuitious JavaScript libraries. Why stand on the shoulders of giants when you can command an army of midgets?
<body> tag). Loading multiple libraries
with duplicate functionality begets redundancy, and redundancy minimizes
downtime.
Because you will probably want to use üjs alongside some other popular libraries which have already claimed the “good” single character namespaces, üjs takes full advantage of Section 7.6 of ES5, which explains:
/**You can see sample usage of üjs in the accompanying unit test.
* Adds umlauts to lowercase vowels in a string.
* @param {string} str
* @return {string}
*/
var ü = function(str) {
return str.replace(/[aeiou]/g, function(ch) {
var m = {
a: 'ä',
e: 'ë',
i: 'ï',
o: 'ö',
u: 'ü'
};
return m[ch] || ch;
});
};
/**
* Spin̈al Tap amplifier volume normalization.
* @param {number} num
* @return {number}
*/
ü.n̈ = function(num) {
return num < 11 ? 11 : num;
};
Përmïssïön tö üsë, cöpy, mödïfy, änd dïstrïbütë thïs söftwärë änd ïts döcümëntätïön för äny pürpösë wïth ör wïthöüt fëë ïs hërëby gräntëd, prövïdëd thät thë äbövë cöpyrïght nötïcë äppëärs ïn äll cöpïës änd thät böth thë cöpyrïght nötïcë änd thïs përmïssïön nötïcë äppëär ïn süppörtïng döcümëntätïön, änd thät thë nämë üjs nöt bë üsëd ïn ädvërtïsïng ör püblïcïty përtäïnïng tö dïstrïbütïön öf thë söftwärë wïthöüt spëcïfïc, wrïttën prïör përmïssïön. üjs mäkës nö rëprësëntätïöns äböüt thë süïtäbïlïty thïs söftwärë för äny pürpösë. It ïs prövïdëd "äs ïs" wïthöüt ëxprëss ör ïmplïëd wärränty.