KScript Dokumentation
DE

Sprache

Automatisch aus dem Englischen übersetzt; das englische Original ist maßgeblich.

Referenz

Jedes Paket, Element, jeder Befehl, jede Methode und jede Variable, so wie Interpreter und Editor sie kennen. Diese Seite entsteht aus denselben Beschreibungen, die kscripts Editor-Unterstützung bei Hover und Vervollständigung anzeigt.

Pakete

KScript.CoreDie Sprache selbst: Variablen, Verzweigungen, Schleifen, Funktionen, Fehler, Importe und echo. Wird immer importiert.KScript.TerminalEingabeaufforderungen, Menüs, Farben, Markdown sowie artisan-artige Beschriftungen, Aufgaben und Tabellen für Terminal-Skripte.KScript.MathWurzeln, Potenzen, Trigonometrie, Logarithmen, Zufallszahlen und Statistik.KScript.IODateien und Ordner: lesen, schreiben, auflisten, verschieben, kopieren und löschen.KScript.NetHTTP-Anfragen (@api) und Downloads.KScript.MarkdownMarkdown zu HTML, mit Front Matter.KScript.WebWebseiten, die kscript serve ausführt: Layouts, Komponenten und Live-Blöcke.KScript.StyleIn KScript geschriebene Stylesheets (.ks.css, .ks.scss, .ks.sass), mit Helfern für Farbe, Größe und Responsive-Design.KScript.StorageApp-Ordner für Konfiguration, Daten, Cache, Zustand und Logs, am richtigen Ort auf jeder Plattform.KScript.DocumentArbeiten, Berichte, Briefe und Rechnungen mit LaTeX-Formeln, gespeichert als PDF, LaTeX, Word, Markdown oder HTML, ohne TeX-Installation.KScript.DataDatenbanken: Modelle, ein Abfrage-Builder, Transaktionen und Roh-SQL, auf SQLite, Postgres, MySQL und MariaDB.KScript.CacheEin Cache für Werte nach Schlüssel, mit Zeitlimits: im Speicher oder in Dateien im Cache-Ordner der App.KScript.QueueWarteschlangen-Jobs: Job-Deklarationen, Dispatch, Wiederholungen mit Backoff, fehlgeschlagene Jobs, der Worker, der sie ausführt, und der Zeitplan für Aufgaben zu festgelegten Zeiten.KScript.MailE-Mail: @send_mail über SMTP, ins Log oder an einen Fake, sofort oder über eine Warteschlange, mit HTML, Text oder einer View, und @fake_mail für Tests.KScript.HttpRouten, Controller und Middleware: <KScript.Routes>-Dateien, die kscript serve ausliefert.KScript.AuthAnmeldung für kscript serve-Apps: Benutzer, Sitzungen, die auth- und guest-Middleware, CSRF, Passwort-Zurücksetzung und API-Tokens.KScript.TestTests, die kscript test ausführt: <test>, <describe>, <expect>, <expect_error>, <capture> und @assert().KScript.UIDesktop-Fenster mit Schaltflächen, Text, Eingabefeldern und Timern, auf macOS, Windows und Linux.KScript.AISprachmodelle (Claude): @llm, @chat und <llm>.

Methoden nach Typ

string78 methods. Text. A string that holds a number can use number methods too.number26 methods. Whole and decimal numbers.bool9 methods. true and false.list72 methods. Lists such as [1, 2, 3]. Methods that change a list return a new one.map30 methods. Maps such as { name: 'Joan', age: 82 }.date15 fields, 18 methods. Dates and times, from @now(), '2026-11-19'->to_date() or ->to_date().fn9 methods. Functions: lambdas fn(x) => $x * 2 and <fn> functions.any8 methods. Methods every value has.type3 fields, 11 methods. A <type> declared by a script, such as Repo.file12 fields, 19 methods. File values, from @file(), @files() and @folders().config15 methods. $config: settings from config files, .env files and the environment.logger2 fields, 20 methods. $log: structured logging.response8 fields, 10 methods. HTTP responses returned by @api($url) in KScript.Net.chat3 fields, 10 methods. Conversations with a language model, from @chat().http_response5 fields, 16 methods. Responses made by controllers and middleware: @response(), @view(), @redirect().base641 field, 21 methods. batch10 fields, 12 methods. cache2 fields, 22 methods. card2 fields, 9 methods. chain11 methods. cidr4 fields, 21 methods. color1 field, 28 methods. country4 fields, 20 methods. cron22 methods. csv1 field, 22 methods. currency3 fields, 21 methods. database4 fields, 16 methods. date_format4 fields, 22 methods. document2 fields, 15 methods. domain2 fields, 24 methods. duration5 fields, 25 methods. email2 fields, 24 methods. error7 fields, 10 methods. error_type5 fields, 8 methods. fake_llm10 methods. fake_mail14 methods. fake_queue14 methods. file_path5 fields, 24 methods. formatted_file2 fields, 12 methods. grouped_query13 methods. handle1 field, 20 methods. hex1 field, 22 methods. iban2 fields, 21 methods. ip3 fields, 22 methods. job10 methods. job_middleware2 fields, 8 methods. jwt4 fields, 20 methods. latex2 fields, 14 methods. locale4 fields, 22 methods. loopback_json_connection9 methods. loopback_json_stream10 methods. markdown2 fields, 14 methods. mime4 fields, 22 methods. model61 methods. money2 fields, 13 methods. money[]73 methods. page_visit4 fields, 14 methods. password14 methods. password_hash10 methods. phone2 fields, 21 methods. progress_bar3 fields, 9 methods. query58 methods. queue2 fields, 15 methods. rate_limit14 methods. record45 methods. regex2 fields, 19 methods. request12 fields, 8 methods. semver4 fields, 24 methods. semver[]73 methods. session1 field, 17 methods. slash_path5 fields, 26 methods. slug1 field, 23 methods. storage3 fields, 24 methods. timezone24 methods. url7 fields, 25 methods. users16 methods. uuid2 fields, 18 methods.

Eingebaute Variablen

Variablen, die ohne Deklaration existieren, etwa $args: siehe Eingebaute Variablen.

Typen, Modelle, Fehler und Einstellungen