# Total.js V5 0.0.20 > The current Total.js framework for Node.js. Choose it for new server-side applications, REST APIs and real-time services. Status: current. License: MIT. Full text in one file: https://totaljs.es/docs/total-js-v5/0-0-20/llms-full.txt Source code: https://github.com/totaljs/framework5 ## Guides - [Introduction](https://totaljs.es/docs/total-js-v5/0-0-20/guides/introduction.md): What Total.js framework v5 is, what the total5 package includes and the main concepts of a Total.js application. - [Installation and first app](https://totaljs.es/docs/total-js-v5/0-0-20/guides/installation.md): Install the total5 package, write the start script, add a first route and action, and run the app in debug and release mode. - [Your first form](https://totaljs.es/docs/total-js-v5/0-0-20/guides/first-form.md): Show a form, receive its data and answer with a new page. - [Migrating from Total.js 4](https://totaljs.es/docs/total-js-v5/0-0-20/guides/migrating-from-total4.md): Move a Total.js 4 application to Total.js 5, area by area, with the code before and after each change. - [Routing](https://totaljs.es/docs/total-js-v5/0-0-20/guides/routing.md): Declare routes with ROUTE(): methods, dynamic paths, authorization, actions, API endpoints, flags, file routes, CORS and proxies. - [Controller](https://totaljs.es/docs/total-js-v5/0-0-20/guides/controller.md): The `$` object of a route action: request data, uploaded files, responses, errors, headers and cookies. - [Actions](https://totaljs.es/docs/total-js-v5/0-0-20/guides/actions.md): Declare business logic with NEWACTION(), validate its input, expose it as a route and run it from code with ACTION(). - [Schemas and validation](https://totaljs.es/docs/total-js-v5/0-0-20/guides/json-schemas.md): Inline schemas, JSON schemas and ErrorBuilder: how Total.js 5 validates and converts data. - [Views](https://totaljs.es/docs/total-js-v5/0-0-20/guides/views.md): HTML views with @{} commands: rendering, layouts, conditions, loops, sections, meta tags, imports, helpers and templates. - [Running in production](https://totaljs.es/docs/total-js-v5/0-0-20/guides/production.md): Run a Total.js application on a server: no watcher, the right address, automatic restarts, nginx, clean stops and logs. - [Configuration](https://totaljs.es/docs/total-js-v5/0-0-20/guides/configuration.md): The config file and its types, .env, CONF, LOADCONFIG() and DEBUG. - [Authorization](https://totaljs.es/docs/total-js-v5/0-0-20/guides/authorization.md): Decide who the user of a request is with AUTH(), protect routes and actions, and use built-in sessions. - [Encryption](https://totaljs.es/docs/total-js-v5/0-0-20/guides/encryption.md): Encrypt values with ENCRYPT() and DECRYPT(), bind them to the client of a request with ENCRYPTREQ() and DECRYPTREQ(), and choose the cipher. - [Audit logs](https://totaljs.es/docs/total-js-v5/0-0-20/guides/audit-logs.md): Record who did what with AUDIT() and $.audit(), audit actions after they succeed, and store the records where you need them. - [Middleware](https://totaljs.es/docs/total-js-v5/0-0-20/guides/middleware.md): Run named functions before routes, WebSockets and actions with NEWMIDDLEWARE(). - [Static files](https://totaljs.es/docs/total-js-v5/0-0-20/guides/static-files.md): Serve the public folder with minification, caching, compression and ranges, and merge files into one. - [WebSockets](https://totaljs.es/docs/total-js-v5/0-0-20/guides/websockets.md): Real-time connections with SOCKET routes, the WebSocket object and its clients, compression, ping and the WebSocket client. - [NoSQL database](https://totaljs.es/docs/total-js-v5/0-0-20/guides/nosql.md): The embedded NoSQL database: NOSQL(name), files in databases/, inserting, finding, updating and removing documents with the query builder. - [QueryBuilder](https://totaljs.es/docs/total-js-v5/0-0-20/guides/querybuilder.md): Query any database with one QueryBuilder: DATA, DB(), adapters, filters, paging and autoquery. - [PostgreSQL](https://totaljs.es/docs/total-js-v5/0-0-20/guides/postgresql.md): Connect to PostgreSQL with DATA.init() and run the QueryBuilder, raw SQL and transactions on it. - [Localization](https://totaljs.es/docs/total-js-v5/0-0-20/guides/localization.md): Translate views, files and messages with resource files, choose the language of each request and create dictionaries with total5 translate. - [HTTP requests](https://totaljs.es/docs/total-js-v5/0-0-20/guides/http-requests.md): Call other HTTP services with RESTBuilder, REQUEST(), AJAX() and DOWNLOAD(). - [OpenClient](https://totaljs.es/docs/total-js-v5/0-0-20/guides/openclient.md): Open a WebSocket connection to another service with OPENCLIENT() and send messages that wait for an answer. - [Sending email](https://totaljs.es/docs/total-js-v5/0-0-20/guides/mail.md): Send e-mail with MAIL(), HTMLMAIL() and LOGMAIL(), configure SMTP, add attachments and build messages with the Mail module. - [Scheduling and events](https://totaljs.es/docs/total-js-v5/0-0-20/guides/scheduling-and-events.md): Crons, global events, the events of the framework, debounced timers, pausing the server and the service timer. - [File storage](https://totaljs.es/docs/total-js-v5/0-0-20/guides/file-storage.md): Store, read, serve and manage binary files with FILESTORAGE(), including uploaded files. - [Plugins and components](https://totaljs.es/docs/total-js-v5/0-0-20/guides/plugins-and-components.md): Plugins in the plugins/ folder, PLUGINS, UI bundles from COMPONENTATOR(), server components with NEWCOMPONENT(), and NPMINSTALL(), REQUIRE() and IMPORT(). - [FlowStream](https://totaljs.es/docs/total-js-v5/0-0-20/guides/flowstream.md): Visual data flows: loading FlowStreams, components, instances, messages and the Total.js Flow editor. - [Message Service (TMS)](https://totaljs.es/docs/total-js-v5/0-0-20/guides/message-service-and-apis.md): Publish events, receive messages and answer calls over TMS. - [APIs](https://totaljs.es/docs/total-js-v5/0-0-20/guides/apis.md): Register named APIs with NEWAPI(), call remote services through them with API(), and use the Total.js API service. - [Workers, threads and cluster](https://totaljs.es/docs/total-js-v5/0-0-20/guides/workers-and-threads.md): Worker threads, thread pools, cluster mode, shell commands, Python scripts and Python pipelines. - [MCP server](https://totaljs.es/docs/total-js-v5/0-0-20/guides/mcp-server.md): Expose actions as tools for AI clients with the built-in MCP endpoint POST /$mcp/ and protect it with Total.mcp.auth; GET /$mcp/client.js gives agents the tools as code. - [Utilities](https://totaljs.es/docs/total-js-v5/0-0-20/guides/utilities.md): The global helpers of Total.js 5: the U/Utils module, identifiers, copies, the in-memory cache, shared objects, PATH, MEMORIZE(), BACKUP() and RESTORE(). - [Prototypes](https://totaljs.es/docs/total-js-v5/0-0-20/guides/prototypes.md): Methods that Total.js adds to String, Number, Date and Array: formatting, parsing, validation, hashing, dates and array helpers. - [Images](https://totaljs.es/docs/total-js-v5/0-0-20/guides/images.md): Resize, crop, convert, watermark and measure images with GraphicsMagick or ImageMagick. - [AI models](https://totaljs.es/docs/total-js-v5/0-0-20/guides/ai-models.md): Register AI model handlers with NEWAIMODEL() and build chat requests with AIMODEL(): messages, config, callbacks, promises, streaming and tool calls. - [Proxy](https://totaljs.es/docs/total-js-v5/0-0-20/guides/proxy.md): Forward requests with PROXY(), and publish an app of a private network through a public Total.js app with PROXYSERVER() and PROXYCLIENT(). - [LDAP](https://totaljs.es/docs/total-js-v5/0-0-20/guides/ldap.md): Read users and groups from an LDAP server such as Active Directory with LDAP(). - [Markdown](https://totaljs.es/docs/total-js-v5/0-0-20/guides/markdown.md): Convert Markdown to HTML with String.prototype.markdown(), and the Markdown syntax it supports. - [HTML and XML parser](https://totaljs.es/docs/total-js-v5/0-0-20/guides/html-parser.md): Parse HTML and XML on the server into a tree of elements that you can search and change. - [Macros](https://totaljs.es/docs/total-js-v5/0-0-20/guides/macros.md): Compile a small rule language into a function with NEWMACRO(), for rules that users write. - [Tangular](https://totaljs.es/docs/total-js-v5/0-0-20/guides/tangular.md): The Tangular template engine: compile and render templates and register helpers. - [Minification](https://totaljs.es/docs/total-js-v5/0-0-20/guides/minification.md): Minify JavaScript, CSS and HTML from your code with the minificators of U. - [CMS compiler](https://totaljs.es/docs/total-js-v5/0-0-20/guides/cms.md): Compile pages made with the Total.js CMS editor and render them with their widgets. - [Application structure and modes](https://totaljs.es/docs/total-js-v5/0-0-20/guides/application-structure.md): The start script, the folders and their loading order, debug and release mode, bundles, remote editing, modules and statistics. - [Unit tests](https://totaljs.es/docs/total-js-v5/0-0-20/guides/unit-tests.md): Write unit tests with the Test runner of total5/test: test groups, results, fake actions and how to run them with total5 test. - [Command line (total5)](https://totaljs.es/docs/total-js-v5/0-0-20/guides/command-line.md): The total5 and flow5 programs: a static web server, translations, minifying, bundles, remote editing, a proxy client, tests and running flows. ## Reference - [Routing](https://totaljs.es/docs/total-js-v5/0-0-20/reference/routing.md): ROUTE() syntax, flags, the route object, CORS(), PROXY() and the routing configuration. - [Controller](https://totaljs.es/docs/total-js-v5/0-0-20/reference/controller.md): Properties and methods of the controller `$` that every route action receives. - [Actions](https://totaljs.es/docs/total-js-v5/0-0-20/reference/actions.md): NEWACTION() options, the $ object, ACTION() callers, NEWSCHEMA() and transformations. - [Schemas and validation](https://totaljs.es/docs/total-js-v5/0-0-20/reference/json-schemas.md): Inline schema types and modifiers, JSON schema keywords, schema methods and ErrorBuilder. - [Views](https://totaljs.es/docs/total-js-v5/0-0-20/reference/views.md): The view commands, the view object, helpers and TEMPLATE(). - [Configuration](https://totaljs.es/docs/total-js-v5/0-0-20/reference/configuration.md): CONF, LOADCONFIG(), DEBUG and every $ key of the framework with its default. - [Authorization](https://totaljs.es/docs/total-js-v5/0-0-20/reference/authorization.md): AUTH(), route flags, permissions, sessions and BLOCKED(). - [Encryption](https://totaljs.es/docs/total-js-v5/0-0-20/reference/encryption.md): ENCRYPT(), DECRYPT(), ENCRYPTREQ(), DECRYPTREQ() and the keys $crypto, $cryptoiv and secret. - [Audit logs](https://totaljs.es/docs/total-js-v5/0-0-20/reference/audit-logs.md): AUDIT(), $.audit(), DEF.onAudit and the audit option of NEWACTION(). - [Middleware](https://totaljs.es/docs/total-js-v5/0-0-20/reference/middleware.md): NEWMIDDLEWARE(), the middleware handler, the #name route flag and the middleware option of actions. - [Static files](https://totaljs.es/docs/total-js-v5/0-0-20/reference/static-files.md): The public folder, cache headers, compression, ranges, MERGE(), TOUCH() and their configuration. - [WebSockets](https://totaljs.es/docs/total-js-v5/0-0-20/reference/websockets.md): The WebSocket object, its clients, WEBSOCKETCLIENT() and the WebSocket configuration. - [NoSQL database](https://totaljs.es/docs/total-js-v5/0-0-20/reference/nosql.md): NOSQL(name), its query builder methods and the NoSQL engine of DATA. - [QueryBuilder](https://totaljs.es/docs/total-js-v5/0-0-20/reference/querybuilder.md): DATA, DB(), NEWDB() and the methods of the QueryBuilder. - [PostgreSQL](https://totaljs.es/docs/total-js-v5/0-0-20/reference/postgresql.md): DATA.init(), the connection string, the SQL results and errors, and the PostgreSQL client. - [Localization](https://totaljs.es/docs/total-js-v5/0-0-20/reference/localization.md): Resource files, @(...) texts, TRANSLATE(), LOCALIZE(), LOADRESOURCE() and the language of a request. - [HTTP requests](https://totaljs.es/docs/total-js-v5/0-0-20/reference/http-requests.md): RESTBuilder, REQUEST(), AJAX(), DOWNLOAD() and Total.download(). - [OpenClient](https://totaljs.es/docs/total-js-v5/0-0-20/reference/openclient.md): OPENCLIENT() and the methods of a client. - [Sending email](https://totaljs.es/docs/total-js-v5/0-0-20/reference/mail.md): MAIL(), HTMLMAIL(), LOGMAIL(), the Mail module, the message object and the SMTP keys. - [Scheduling and events](https://totaljs.es/docs/total-js-v5/0-0-20/reference/scheduling-and-events.md): CRON(), ON(), ONCE(), OFF(), EMIT(), the built-in events, setTimeout2(), CLEANUP() and PAUSESERVER(). - [File storage](https://totaljs.es/docs/total-js-v5/0-0-20/reference/file-storage.md): FILESTORAGE() and its methods, the file metadata, the @upload flag and file.fs(). - [Plugins and components](https://totaljs.es/docs/total-js-v5/0-0-20/reference/plugins-and-components.md): The plugin definition, PLUGINS, COMPONENTATOR(), NEWCOMPONENT() with its Component, Instance and Message objects, NPMINSTALL(), REQUIRE() and IMPORT(). - [FlowStream](https://totaljs.es/docs/total-js-v5/0-0-20/reference/flowstream.md): The Flow global, running FlowStreams, components, instances, messages and the flow5 command. - [Message Service (TMS)](https://totaljs.es/docs/total-js-v5/0-0-20/reference/message-service-and-apis.md): TMS functions, the TMS client and their configuration keys. - [APIs](https://totaljs.es/docs/total-js-v5/0-0-20/reference/apis.md): NEWAPI(), API() and its methods, TotalAPI() and their configuration keys. - [Workers, threads and cluster](https://totaljs.es/docs/total-js-v5/0-0-20/reference/workers-and-threads.md): NEWTHREAD(), NEWFORK(), NEWTHREADPOOL(), F.worker, the cluster options, SHELL(), F.python(), F.pipinstall() and PYPELINE(). - [MCP server](https://totaljs.es/docs/total-js-v5/0-0-20/reference/mcp-server.md): The $mcp key, the mcp option of actions, the JSON-RPC methods of POST /$mcp/, the client of GET /$mcp/client.js and Total.mcp. - [Utilities](https://totaljs.es/docs/total-js-v5/0-0-20/reference/utilities.md): U/Utils functions, global helpers (UID, GUID, HASH, CLONE, COPY, DIFFARR, QUERIFY, PROMISIFY), shared objects, CACHE, MEMORIZE, BACKUP, RESTORE and PATH. - [Prototypes](https://totaljs.es/docs/total-js-v5/0-0-20/reference/prototypes.md): Every method that Total.js adds to String, Number, Date and Array.prototype. - [Images](https://totaljs.es/docs/total-js-v5/0-0-20/reference/images.md): The Image global and every method of image objects. - [AI models](https://totaljs.es/docs/total-js-v5/0-0-20/reference/ai-models.md): NEWAIMODEL(), AIMODEL(), the request methods and properties, and the AI stream parser. - [Proxy](https://totaljs.es/docs/total-js-v5/0-0-20/reference/proxy.md): PROXYSERVER() and PROXYCLIENT(). - [LDAP](https://totaljs.es/docs/total-js-v5/0-0-20/reference/ldap.md): LDAP() and its options. - [Markdown](https://totaljs.es/docs/total-js-v5/0-0-20/reference/markdown.md): String.prototype.markdown() and the Markdown syntax. - [HTML and XML parser](https://totaljs.es/docs/total-js-v5/0-0-20/reference/html-parser.md): String.prototype.parseHTML(), HTMLElement and the methods of an element. - [Macros](https://totaljs.es/docs/total-js-v5/0-0-20/reference/macros.md): NEWMACRO() and the macro syntax. - [Tangular](https://totaljs.es/docs/total-js-v5/0-0-20/reference/tangular.md): Tangular.compile(), Tangular.render(), Tangular.register() and Tangular.helpers. - [Minification](https://totaljs.es/docs/total-js-v5/0-0-20/reference/minification.md): U.minify_css(), U.minify_js() and U.minify_html(). - [CMS compiler](https://totaljs.es/docs/total-js-v5/0-0-20/reference/cms.md): F.TCMS.compile(), the methods of a compiled page, F.TCMS.widgets() and F.TCMS.run(). - [Application structure and modes](https://totaljs.es/docs/total-js-v5/0-0-20/reference/application-structure.md): F.run() and its start options, LOAD(), IMPORT(), REQUIRE(), MODS and the framework statistics. - [Unit tests](https://totaljs.es/docs/total-js-v5/0-0-20/reference/unit-tests.md): The Test runner of total5/test: Test.push(), Test.run(), Test.print(), Test.start(), Test.fake(), Test.restore(), Test.count and Test.items. - [Command line (total5)](https://totaljs.es/docs/total-js-v5/0-0-20/reference/command-line.md): Every command and argument of the total5 and flow5 programs. ## Changelog - [0.0.20](https://totaljs.es/docs/total-js-v5/0-0-20/changelog/0-0-20.md): What changed in release 0.0.20. - [0.0.19](https://totaljs.es/docs/total-js-v5/0-0-20/changelog/0-0-19.md): What changed in release 0.0.19 (2026-09-29). - [0.0.18](https://totaljs.es/docs/total-js-v5/0-0-20/changelog/0-0-18.md): What changed in release 0.0.18 (2026-06-29). - [0.0.17](https://totaljs.es/docs/total-js-v5/0-0-20/changelog/0-0-17.md): What changed in release 0.0.17 (2026-06-01). - [0.0.16](https://totaljs.es/docs/total-js-v5/0-0-20/changelog/0-0-16.md): What changed in release 0.0.16 (2026-03-31). - [0.0.15](https://totaljs.es/docs/total-js-v5/0-0-20/changelog/0-0-15.md): What changed in release 0.0.15 (2025-12-04).