Total.js is a full-stack, open-source Node.js framework designed for creating web applications, REST services, real-time applications, and IoT solutions. Written in pure JavaScript without external dependencies (beyond optional database connectors or specific modules), it aims for high performance and clean architecture, similar to MVC frameworks like Laravel or Django. The framework emphasizes backward compatibility, with version 3 (3.4.13 being a recent patch) receiving frequent updates and bug fixes. It includes a built-in web server, static file handling, powerful routing, an embedded NoSQL database (TextDB), image processing via GraphicsMagick or ImageMagick, WebSockets, a custom view engine, and a schema system for data validation and workflows. Total.js differentiates itself by providing a comprehensive, independent platform often used with its ecosystem of tools like Total.js Code Editor and CMS. While Total.js v3 is actively maintained, the project has transitioned to newer major versions (v4, `total4` on npm, and v5, `total5` on npm), which introduce significant architectural changes and target newer Node.js versions, although v3 continues to be supported for existing projects.
npm install total.jsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Total.js framework, start a basic HTTP server, and define two simple GET routes that respond with plain text and JSON respectively, using the global `ROUTE` function and `framework.http()` method.
For new projects, consider `total4` or `total5` for modern Node.js features and ongoing development. For existing v3 projects, stick to `total.js` and be aware of the `total.js` v3 documentation. Migrating to v4/v5 involves installing `total4`/`total5` and adapting to changes in routing, NoSQL, and potentially other core components.
Familiarize yourself with the Total.js documentation regarding its global API and recommended project structure. Adhere to the framework's conventions for defining routes, controllers, and other components rather than attempting to `import` these globals.
Always follow the recommended Total.js project structure for clarity and automatic component discovery. If a custom structure is necessary, consult the documentation for manual configuration options for controllers, views, and other elements.
Ensure GraphicsMagick or ImageMagick are installed and configured correctly on your server's operating system (e.g., `sudo apt-get install graphicsmagick` on Debian/Ubuntu, or using a package manager for other OS). Check Total.js documentation for specific requirements and troubleshooting.
Continue using CommonJS `require()` for the Total.js framework itself. For application-specific modules within a Total.js v3 project, use `require()` for consistency. If you need ESM, consider migrating to Total.js v4 or v5, which may offer better ESM compatibility, or use a build tool like Webpack/Rollup if you need to transpile ESM to CJS for your application code.
Ensure `total.js` is installed locally in your project: `npm install total.js` or globally if using its CLI tools: `npm install -g total.js`. Also, verify your `index.js` or `app.js` file is in the correct location or the `require` path is accurate.
Ensure `require('total.js')();` or `require('total.js').http('debug');` is called at the very beginning of your main application entry file (`app.js` or `index.js`), before any routes or controllers are defined. The framework needs to bootstrap itself to expose its globals.Install GraphicsMagick or ImageMagick on your operating system. For Debian/Ubuntu, use `sudo apt-get install graphicsmagick` or `sudo apt-get install imagemagick`. For other OS, refer to their respective package managers or installation guides.
No dependency data recorded yet.