Registry / web-framework / total4

total4

JSON →
library0.0.99jsnpmunverified

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.

npm install total4
INSTALL
IMPORT
SIG · TOTAL4
T
total4
web-frameworkjavascriptv0.0.99
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

total4
const total4 = require('total4')
import total4 from 'total4'
Total.js framework v4 is CommonJS-only; ESM imports are not supported.
Framework
const Framework = require('total4/framework')
import { Framework } from 'total4'
For accessing the Framework class, use the explicit path. The main export is the global framework instance.
U
const U = require('total4/utils')
import U from 'total4'
Utility functions are exported from 'total4/utils'.
Controller
const Controller = require('total4/controller')
Controller class is available via 'total4/controller'.

Creates a minimal HTTP server using Total.js framework v4's event-driven request handler.

const total4 = require('total4'); // Create a simple web server F.on('request', function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello from Total.js v4!'); }); F.listen(3000, '0.0.0.0', function() { console.log('Server running at http://localhost:3000/'); });
total4 --version
Debug
Known issues
breakingTotal.js v4 is a complete rewrite and not backward compatible with v3. Existing v3 applications must be migrated.
fix
Refer to migration guide at https://docs.totaljs.com/total4/migration/.
affects: >=3.0.0 <4.0.0
deprecatedThe 'F.route()' method from v3 is replaced by 'F.on('request')' in v4.
fix
Use F.on('request', handler) instead of F.route().
affects: >=4.0.0
gotchaESM imports (import) are not supported; require() must be used.
fix
Use CommonJS require() calls instead of import statements.
affects: >=4.0.0
gotchaThe package name is 'total4' not 'total.js' when installing from npm.
fix
Run npm install -g total4 (not total.js).
affects: >=4.0.0
deprecatedBuilt-in CORS support has been removed; you must handle CORS manually.
fix
Set CORS headers in your request handler as needed.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'total4'
Package not installed or installed globally without proper NODE_PATH.
fix
Install locally: npm install total4 --save, then run node with correct path.
TypeError: F.on is not a function
F is not defined because the framework instance wasn't created.
fix
Ensure you have called require('total4') which creates the global F object.
SyntaxError: Unexpected token import
Using ES module import syntax with a CommonJS-only package.
fix
Replace 'import total4 from 'total4'' with 'const total4 = require('total4')'.
Error: listen EADDRINUSE :::3000
Port 3000 is already in use by another process.
fix
Change the port number or terminate the conflicting process.
Upgrade
Version history
0.0.99latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
Meta
2
OpenAI (training)
1
Resources
total4 — npm install total4 · libregistry