A high-performance JS orchestration layer that eliminates virtual DOM overhead. Decoupled, asynchronous, and remarkably clean.
core.js delivers a Shadow-less Rendering engine that treats the DOM as the state tree, eliminating virtual DOM diffing overhead.
Its Async-Native architecture fetches data and
templates in parallel using modern async/await
patterns.
The built-in Cloner Engine enables nested, recursive component definitions that hydrate automatically on data insertion.
core.ud.preflight
Modify fetch settings before a request
core.ud.postflight
Transform response data after fetch
core.ud.prepaint
Adjust data before rendering
core.ud.postpaint
Run logic after template is rendered
<template name="userCard">
<div class="user-card">
<h3>{{rec:name}}</h3>
<p>{{rec:email}}</p>
</div>
</template>
<div class="core-pocket"
data-core-templates="userCard"
data-core-source-users="https://api.example.com/users">
</div>
<!-- Format as money -->
{{rec:price:money:$}}
<!-- Recursive cloning -->
{{rec:items:core_pk_cloner:itemTemplate}}
Use target="core_be_getData"
to fetch data or templates without immediate UI updates.
core.js automatically manages the serialization of your state directly into the DOM, allowing for instant "resurrection" of UI components without virtual DOM overhead.
Fetch in progress...
— System ArchitectFetch in progress...
Enter your info to generate a profile page.
Breaking updates from the underground network.
{{rec:description}}
| Dev ID | Interface | Sync Status | Action |
|---|---|---|---|
| #{{aug:count}} | {{rec:firstName}} {{rec:lastName}} | ACTIVE | Pocket Source |
Create Once, Render Everywhere — Orchestration without Overhead.
Choose your preferred CDN option. No build tools required.
<!-- Option A: Production version via CDN -->
<script src="https://cdn.jsdelivr.net/gh/Sitezip/core.sbs/core.js"></script>
<!-- Option B: Historical version via CDN (advised) -->
<script src="https://cdn.jsdelivr.net/gh/Sitezip/core.sbs@20251212.0/core.js"></script>
<!-- Option C: Production -->
<script src="https://core.sbs/core.js"></script>
core.js is dependency-free. Just import the script and start defining pockets of logic in your HTML.
Templates and data live inside a hidden cr-data
section.
<section id="cr-data" style="display:none;">
<template name="users">
<div class="user-card">
<h3>{{rec:name}}</h3>
<p>{{rec:email}}</p>
</div>
</template>
</section>
Pockets are insertion points that fetch their own data.
<div class="core-pocket"
data-core-templates="users"
data-core-source-users="api/v1/users">
</div>
| Attribute | Target | Description |
|---|---|---|
| data-core-templates | Element / Anchor | Comma-separated list of templates to render. |
| data-core-source | Element / Clone | URL or JSON string for the primary data source. |
| data-core-data | Clone / Silent | A custom reference name for the fetched data. |
| data-[name]-core-source | Element / Anchor | A specific data source for a named template in the stack. |
Syntax: {{type:ref:format:clue}}
Reference to a member of the current record being cloned.
Augmented runtime values (index, count, custom strings).
Global reference to any cached data source in the registry.
// Deep object traversal
{{rec:customer.shipping.address.city}}
// Array index and listing
{{rec:tags.1}} // Index 1
Formatting & PipingChain multiple formats using the pipe
|
delimiter.
The core.ud (User Defined)
registry allows you to intercept every stage of the orchestration.
core.ud.cloneValue(record, args)
Invoked by
{{aug:value}} during cloning to return custom dynamic values
based on the record.
core.ud.cloneString(record, args)
Invoked by
{{aug:string}}. Allows raw manipulation of the template string
before it's injected.
core.ud.getTemplate(name, templateStr)
Modify fetched templates <!-- defining data/template silent request --> <button class="nav-link" data-target="core_be_getData" data-core="silent" data-core-source-silent="https://dummyjson.com/products?limit=1"> Silent Data</button> <button class="nav-link" data-target="core_be_getTemplate" data-core="author" data-core-source-author="/html/author.html"> Silent Template</button>
copy(text)
Copy to clipboard with invisible textarea fallback.
uuid()
Generate a compliant v4-like unique identifier.
sortObj(arr, key)
High-performance object array sorting (ASC/DESC).
digData(obj, ref)
The engine's internal recursive digging logic.
date(str, format)
Versatile date formatter with TS/ISO/PERF tokens.
Static anchor tags can trigger background syncs without any UI flicker or state transition.
// Silent Data Fetching
<a href="#"
target="core_be_getData"
data-core-data="globalStore"
data-core-source="api/data">
Background Sync
</a>
Access `core.be.fetchLogFIFO` to view every network request's history and configuration.
Manually push data to specific storage layers (DOM, dataset, or session) via `core.cr.setData`.
Quick logic snippets and implementation patterns for power users.
<button data-core="other"
data-target="#main">Navigate</button>
Defining a specific viewhost (target) and template chain.
{{rec:email:emaillink:class="link"}}
{{rec:thumbnail:imgsrc:class="img"}}
{{rec:price:money:$}}
{{rec:name:upper}}
Formatting tokens: money, date, upper, lower, linkify, imgsrc.
core.ud.preflight = (ref, src, type) => {
return {dataRef: ref, dataSrc: src};
}
core.ud.postflight = (ref, obj, type) => {
return obj;
}
// Recursive cloner pattern
{{rec:items:core_pk_cloner:colors}}
Allows for infinite nesting of data structures (e.g. tree views, threaded comments).
Infinite nesting with recursive data patterns
Create infinitely nested data structures with recursive templates and logic chains. Perfect for tree views, nested comments, hierarchical data displays like org charts, file explorers, nested menus, collapsible content, interactive dashboards, dynamic content hierarchies, nested UI components, complex nested data visualizations, and deeply nested logical expressions.
{{rec:hex}}
{{rec:rgb}}
A lightweight, client-side rendering and state management library designed to facilitate the decoupling of data, templates, and DOM logic through modern asynchronous patterns.
No virtual DOM overhead
Promise-based architecture
Component architecture
Vanilla JavaScript only
core.js operates on a lifecycle-driven approach, identifying specific "pockets" in the DOM and populating them with hydrated templates. It provides a robust suite of utility functions for data validation, formatting, and backend synchronization.
soc() - Start of Call
getTemplate() - Batch template requests
getData() - Batch data requests
eoc() - End of Call (cleanup)
<!-- Production version -->
<script src="https://core.sbs/core.js"></script>
<!-- Specific version (recommended) -->
<script src="https://cdn.jsdelivr.net/gh/Sitezip/core.sbs@20251212.0/core.js"></script>
<script src="core.js"></script>
<link rel="stylesheet" href="core.css">
After installation, simply call core.init() to initialize the engine.
<section id="cr-data" style="display:none;">
<template name="userprofile">
<div class="profile-card">
<h1>{{data:userprofile:name}}</h1>
<div class="core-clone" data-core-data="userprofile:posts">
<p>{{rec:title}}</p>
</div>
</div>
</template>
</section>
<div class="core-pocket"
data-core-templates="userprofile"
data-userprofile-core-source="/api/user/123">
</div>
<script>
core.init();
</script>
core.js will automatically fetch the data and render your template. No additional JavaScript required!
Handles all external I/O using the Fetch API with built-in promise tracking to prevent race conditions.
getData(dataRef, dataSrc, settings) -
Retrieves JSON datagetTemplate(dataRef, dataSrc, settings) -
Retrieves HTML templatesawaitAll() - Global synchronization method
Manages the internal state of the application with multiple storage tiers.
setData(name, data, elem, storageId) - Store
datagetTemplate(name) - Retrieve and hydrate
templateThe core engine responsible for DOM manipulation and rendering.
soc() - Start of Call, awaits backend requests
getTemplate() - Batches template requestsaddTemplate() - Injects static templatesgetData() - Batches data requestsaddData() - Performs cloning and hydration
eoc() - End of Call, cleanup and formatting
Double Curly Syntax:
{{type:source:reference:format}}
data: - Global registry lookuprec: - Current record lookupaug: - Augmented metadata (index, count)
Comprehensive validation engine for data sanitization and formatting.
scrub(scrubArr) - Validate input objectsformat(value, formatStr) - Transform datareq - Required fieldemail - Email validationurl - URL validationmin/max - Length/range validationUtility methods for common operations.
digData(object, path) - Deep-seek values in nested
JSONdate(dateStr, format) - Robust date formatting
hydrateByClass() - Mass-hydration by CSS class
formatByClass() - Mass-formatting by CSS class
Extend the engine's behavior by defining hooks in the core.ud (User Defined) namespace.
| Hook | Description |
|---|---|
soc() |
Executed before the rendering lifecycle begins |
eoc() |
Executed after rendering lifecycle and DOM updates are complete |
preflight() |
Intercepts backend requests before they are dispatched |
postflight() |
Processes backend responses before they are committed to the registry |
prepaint() |
Executed before a specific template or data block is injected |
postpaint() |
Executed after injection and cloner execution |
core.useDebugger - Enable verbose console loggingcore.useRouting - Enable URL hash-based state
persistencecore.baseUrl - Define root path for dynamic module
importscore.ud.init = () => {
core.useDebugger = window.location.hostname === 'localhost';
core.useRouting = true;
core.baseUrl = '/modules';
};
Syntax:
{{type:object-member:format:clue}}
| Syntax | Description |
|---|---|
{{rec:name}} |
Simple property access |
{{data:userprofile:name}} |
Global registry lookup |
{{rec:balance:money:$}} |
Currency formatting with dollar sign |
{{rec:status:upper}} |
Uppercase transformation |
{{rec:email:emaillink}} |
Email link generation |
{{rec:url:urllink}} |
URL link generation |
{{rec:image:imgsrc}} |
Image source attribute |
{{rec:customer.address.city}} |
Nested property access |
{{rec:items:core_pk_cloner:item}} |
Array cloning with template |
{{aug:index}} |
Current record index in clone loop |
{{aug:count}} |
Total number of records |
| Attribute | Description | Example |
|---|---|---|
data-core-templates |
Template names to load | data-core-templates="user,profile" |
data-core-source |
Default data source URL | data-core-source="/api/user" |
data-core-source-[name] |
Template-specific source | data-core-source-profile="/api/profile" |
data-core-data |
Data reference for clones | data-core-data="users:posts" |
| Method | Description | Example |
|---|---|---|
core.init() |
Initialize the engine | core.init() |
core.cr.setData(name, data) |
Store data in registry | core.cr.setData('user', {name: 'John'}) |
core.cr.getData(name) |
Retrieve data from registry | const user = core.cr.getData('user') |
core.be.getData(ref, src) |
Fetch data from URL | core.be.getData('users', '/api/users') |
core.be.awaitAll() |
Wait for all requests to complete | await core.be.awaitAll() |
core.js provides nohtml
and removehtml scrubbers. Apply these to
user-generated content before injection.
{{rec:userInput:nohtml}}
Storage ID 1 (Static)
exposes data in the DOM. Use Storage ID 0 (DOM) for
sensitive state data.
core.cr.setData('sensitive', data, elem, 0)
<section id="cr-data" style="display:none;">
<template name="users">
<div class="user-card">
<h3>{{rec:name}}</h3>
<p>{{rec:email}}</p>
</div>
</template>
</section>
<div class="core-pocket"
data-core-templates="users"
data-core-source-users="api/v1/users">
</div>
<section id="cr-data" style="display:none;">
<template name="productList">
<div class="product">
<h3>{{rec:title}}</h3>
<p>{{rec:description}}</p>
<div class="price">{{rec:price:money:$}}</div>
</div>
</template>
</section>
<div class="core-pocket"
data-core-templates="productList"
data-core-source-productList="https://fakestoreapi.com/products">
Loading products...
</div>
<section id="cr-data" style="display:none;">
<template name="colors">
<div class="color-item">
<span>{{rec:name:upper}}</span>
<span>{{rec:value}}</span>
<div>{{rec:children:core_pk_cloner:colors}}</div>
</div>
</template>
</section>
<div class="core-clone"
data-core-source="https://api.example.com/colors">
<div class="color-item">
<span>{{rec:name:upper}}</span>
<span>{{rec:value}}</span>
<div>{{rec:children:core_pk_cloner:colors}}</div>
</div>
</div>
<section id="cr-data" style="display:none;">
<template name="transaction">
<div class="transaction">
<span class="user">{{rec:name:upper}}</span>
paid
<span class="amount">{{rec:paid:money:$}}</span>
on
<span class="date">{{rec:ts:date:date}}</span>
for
<span class="item">{{rec:stuff.food}}</span>
<div class="details">
{{rec:more:core_pk_cloner:details}}
</div>
</div>
</template>
</section>
<div class="core-clone"
data-core-source="https://dummyjson.com/products?limit=1">
<div class="transaction">
<span class="user">{{rec:name:upper}}</span>
paid
<span class="amount">{{rec:paid:money:$}}</span>
on
<span class="date">{{rec:ts:date:date}}</span>
for
<span class="item">{{rec:stuff.food}}</span>
<div class="details">
{{rec:more:core_pk_cloner:details}}
</div>
</div>
</div>
<section id="cr-data" style="display:none;">
<template name="userProfile">
<h2>{{rec:name}}</h2>
<p>{{rec:email}}</p>
<div class="orders">
{{rec:orders:core_pk_cloner:orderItem}}
</div>
</template>
<template name="orderItem">
<div class="order">
<span>{{rec:product}}</span>
<span>{{rec:price:money:$}}</span>
</div>
</template>
</section>
<div class="core-pocket"
data-core-templates="userProfile"
data-core-source-userProfile="api/v1/users/123"
data-core-source-orderItem="api/v1/orders">
</div>
Copy these code examples into your HTML file and watch core.js work its magic!
Copyright (c) 2025 CORE_ORCHESTRATOR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
core.js is a small, honest UI runtime. It exists to ship real software, not to grow a framework ecosystem.
We ship usable software as soon as it’s real. Not perfect. Not overdesigned. Not wrapped in roadmap theater. If it exists, it runs. If it runs, it ships.
New ideas are welcome. Breaking working applications is not. If something breaks: it’s a bug, it gets fixed quickly, or it gets reverted. Stability is earned through discipline, not promises.
Fixes belong in the core. Not in forks, not in wrappers, and not in project-specific hacks. If something requires a workaround, the core is wrong. We fix the core.
Every API has a cost. Every layer is a liability. We prefer fewer concepts, explicit behavior, and boring primitives that compose well. If it can’t be explained quickly, it doesn’t belong.
We don’t design in isolation. core.js is used to build real applications. Feedback comes from production, constraints, and mistakes—not hypotheticals.
core.js is not everything for everyone. It does one job well and stays out of your way. If you want magic, indirection, or framework gravity, React already exists.
The browser is the platform. JavaScript is the contract. We don’t fight the environment. We work with it.