{"id":26493,"library":"total4","title":"Total.js framework 4","description":"Total.js framework v4 (v0.0.99) is a Node.js web framework written in pure JavaScript, similar to PHP's Laravel or Python's Django. It supports web, desktop, service, and IoT applications. Known for its high performance and minimalistic design, it includes built-in support for MVC architecture, real-time communication, and a rich set of components. The framework is actively developed with frequent releases on npm. It is fully TypeScript-typed and ships with its own CLI tool. Compared to Express.js, it offers a more opinionated structure and built-in modules for common tasks.","status":"active","version":"0.0.99","language":"javascript","source_language":"en","source_url":"https://github.com/totaljs/framework4","tags":["javascript","total.js","total4","framework","mvc","web","platform","typescript"],"install":[{"cmd":"npm install total4","lang":"bash","label":"npm"},{"cmd":"yarn add total4","lang":"bash","label":"yarn"},{"cmd":"pnpm add total4","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Total.js framework v4 is CommonJS-only; ESM imports are not supported.","wrong":"import total4 from 'total4'","symbol":"total4","correct":"const total4 = require('total4')"},{"note":"For accessing the Framework class, use the explicit path. The main export is the global framework instance.","wrong":"import { Framework } from 'total4'","symbol":"Framework","correct":"const Framework = require('total4/framework')"},{"note":"Utility functions are exported from 'total4/utils'.","wrong":"import U from 'total4'","symbol":"U","correct":"const U = require('total4/utils')"},{"note":"Controller class is available via 'total4/controller'.","wrong":null,"symbol":"Controller","correct":"const Controller = require('total4/controller')"}],"quickstart":{"code":"const total4 = require('total4');\n// Create a simple web server\nF.on('request', function(req, res) {\n    res.writeHead(200, { 'Content-Type': 'text/plain' });\n    res.end('Hello from Total.js v4!');\n});\nF.listen(3000, '0.0.0.0', function() {\n    console.log('Server running at http://localhost:3000/');\n});","lang":"javascript","description":"Creates a minimal HTTP server using Total.js framework v4's event-driven request handler."},"warnings":[{"fix":"Refer to migration guide at https://docs.totaljs.com/total4/migration/.","message":"Total.js v4 is a complete rewrite and not backward compatible with v3. Existing v3 applications must be migrated.","severity":"breaking","affected_versions":">=3.0.0 <4.0.0"},{"fix":"Use F.on('request', handler) instead of F.route().","message":"The 'F.route()' method from v3 is replaced by 'F.on('request')' in v4.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use CommonJS require() calls instead of import statements.","message":"ESM imports (import) are not supported; require() must be used.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Run npm install -g total4 (not total.js).","message":"The package name is 'total4' not 'total.js' when installing from npm.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Set CORS headers in your request handler as needed.","message":"Built-in CORS support has been removed; you must handle CORS manually.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install locally: npm install total4 --save, then run node with correct path.","cause":"Package not installed or installed globally without proper NODE_PATH.","error":"Error: Cannot find module 'total4'"},{"fix":"Ensure you have called require('total4') which creates the global F object.","cause":"F is not defined because the framework instance wasn't created.","error":"TypeError: F.on is not a function"},{"fix":"Replace 'import total4 from 'total4'' with 'const total4 = require('total4')'.","cause":"Using ES module import syntax with a CommonJS-only package.","error":"SyntaxError: Unexpected token import"},{"fix":"Change the port number or terminate the conflicting process.","cause":"Port 3000 is already in use by another process.","error":"Error: listen EADDRINUSE :::3000"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}