Skip to content

sparkles:base

sparkles:base is the shared foundation for Sparkles libraries: small allocation-conscious buffers, recycled Error storage for @nogc code, text readers/writers, terminal styling, styled Interpolated Expression Sequences, and the core logging interface.

Use it when a package needs low-level building blocks without depending on the higher-level sparkles:core-cli UI and argument-parsing modules.

d
import sparkles.base.smallbuffer : SmallBuffer;
import sparkles.base.text.writers : writeIntegerPadded;

SmallBuffer!(char, 16) buf;
writeIntegerPadded(buf, 7, 3);
assert(buf[] == "007");

How this documentation is organised

These docs follow the Diátaxis framework.

Tutorial

Learning-oriented. Build one small program using the buffer, text writer, styled text, and logger primitives.

How-to guides

Task-oriented. Short recipes for common jobs.

Reference

Information-oriented. Lookup material for modules and symbols.

Explanation

Understanding-oriented. Why base exists as a separate package.