Most of these are jQuery classics kept for compatibility ($.each, $.extend, $.param, $.trim, the $.is* checks). jsKjs adds a few modern essentials: $.escape() for safe HTML strings, $.uuid() backed by crypto.randomUUID(), and $.easings.
$.extend(true, …) deep-merges and refuses __proto__, constructor and prototype keys, so merging untrusted JSON can't pollute Object.prototype — the class of bug behind jQuery's CVE-2019-11358.
Click the button — each line is real output.
View the source for this demo
<div class="row"><button type="button" id="run-utils">Run every utility</button></div>
<pre class="out" id="util-console" aria-live="polite">Click the button — each line is real output.</pre>$('#run-utils').on('click', () => {
const lines = [];
const p = (call, value) => lines.push('<span class="k">' + $.escape(call) + '</span>\n → ' + $.escape(String(value)));
p('$.version', $.version);
p("$.param({ a: 1, b: 'x y' })", $.param({ a: 1, b: 'x y' }));
p("$.escape('<img onerror=alert(1)>')", $.escape('<img onerror=alert(1)>'));
p('$.uuid()', $.uuid());
p("$.trim(' padded ')", "'" + $.trim(' padded ') + "'");
p('$.isArray([]) · $.isFunction($) · $.isPlainObject({})', [$.isArray([]), $.isFunction($), $.isPlainObject({})].join(' · '));
p('$.map([1, 2], n => [n, n * 10])', JSON.stringify($.map([1, 2], n => [n, n * 10])));
const seen = []; $.each({ a: 1, b: 2 }, (k, v) => seen.push(k + '=' + v));
p('$.each({ a: 1, b: 2 }, fn)', seen.join(', '));
p('$.extend(true, { a: { b: 1 } }, { a: { c: 2 } })', JSON.stringify($.extend(true, { a: { b: 1 } }, { a: { c: 2 } })));
$.extend(true, {}, JSON.parse('{"__proto__": {"hacked": true}}'));
p('prototype pollution attempt → ({}).hacked', ({}).hacked);
p("$.parseHTML('<li>Hi</li>')[0].tagName", $.parseHTML('<li>Hi</li>')[0].tagName);
p("Object.keys($.easings).length", Object.keys($.easings).length);
$('#util-console').html(lines.join('\n'));
});More examples
noConflict
// Another library owns $? Keep both.
const kj = $.noConflict(); // window.$ goes back to the old value
kj('#app').addClass('ready'); // jsKjs is also always available as window.kj and window.jsKjsAPI
Iterate arrays, array-likes, or plain objects.
Reference: $.each() →Merge objects; pass true first for deep merge.
HTML-escape text — use it whenever you string-build HTML from user data.
Reference: $.escape() →Small predicates and string trim, kept for jQuery compatibility.
Reference: Type checks →Restore the previous window.$ and return jsKjs (also always available as kj and jsKjs).
Migrating
$.trim, $.isArray and $.isFunction; jsKjs keeps them so older code runs. $.Deferred, $.Callbacks, $.when and $.grep are not included — use Promises and Array.prototype.filter.Related features
Debounce & throttle
See the difference between debounce and throttle in real time: raw, throttled and debounced event lanes driven by your pointer.
Open →CoreAttributes, properties & data
Read and write HTML attributes, live DOM properties and per-element data.
Open →CoreSelectors & collections
Use $() exactly like jQuery — CSS selectors, context, HTML creation and DOM-ready — powered by native querySelectorAll, with collections that are real JavaScript arrays..
Open →