Registry / web-framework / foam-framework

foam-framework

JSON →
library0.5.0jsnpmunverified

FOAM is described as a full-stack reactive MVC metaprogramming framework primarily implemented in JavaScript. Its core value proposition focuses on building high-performance applications with reduced size and increased developer efficiency, allowing for code generation targeting various languages and platforms. The project appears to be an early-stage or abandoned framework, indicated by its low version number (0.5.0), the use of 'nodejs' (rather than 'node') in examples, a dependency on Google Groups for discussions, and the primary distribution method involving direct HTML script inclusion or pre-bundled `foam.js` files. It predates widespread adoption of modern JavaScript module systems like CommonJS or ESM, typically relying on global scope for accessibility. There is no clear release cadence, and the framework's 'no build' claim for demos contrasts with a build tool for optimized deployment, suggesting a workflow that might be incompatible with contemporary front-end development practices. Key differentiators include its metaprogramming capabilities and focus on efficient code generation, though its current relevance is limited given its apparent inactivity.

npm install foam-framework
INSTALL
IMPORT
SIG · FOAM-FRAMEWORK
F
foam-framework
web-frameworkjavascriptv0.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

FOAM
<!-- Load foam.js into an HTML page --> <script src="path/to/foam.js"></script> <!-- FOAM will then be available globally, e.g., window.FOAM -->
import { FOAM } from 'foam-framework'; const FOAM = require('foam-framework');
FOAM is primarily designed for global script inclusion in HTML environments, making the `FOAM` object available on the `window` object. It does not support modern JavaScript module systems like CommonJS or ESM for direct programmatic imports from the npm package.

Demonstrates how to use the framework's `foam.js` build tool to generate a bundled application from a specified controller model for deployment.

nodejs tools/foam.js foam.build.BuildApp controller=my.controller.Model targetPath=. // This command runs the FOAM build tool to generate a bundled application. // 'my.controller.Model' should be replaced with the actual path to your application's main controller model. // The 'targetPath' specifies where the output (e.g., foam.js and foam.html) will be placed.
Debug
Known issues
breakingFOAM is likely incompatible with modern JavaScript syntax (ES2015+) and recent Node.js versions. Its development predates many contemporary language features and runtime advancements, potentially leading to syntax errors or runtime issues.
fix
This framework is generally not recommended for new projects. For existing projects, consider a full migration to a modern framework or extensive polyfilling and environment setup if strict compatibility is required.
affects: 0.5.0
gotchaThe framework operates by exposing itself globally (e.g., `window.FOAM`) when loaded via script tags. This can lead to global scope pollution and potential conflicts with other libraries or scripts that might use similar global variable names.
fix
Carefully manage the order of script loading and be aware of potential global namespace clashes. Isolate FOAM usage where possible or wrap it within an immediately invoked function expression (IIFE) if supported, though the latter might interfere with its internal bootstrapping.
affects: 0.5.0
gotchaFOAM does not support modern JavaScript module systems (CommonJS, ESM). Attempts to `import` or `require` modules from the `foam-framework` npm package will fail, as it expects direct script inclusion or use of its build tools.
fix
Utilize the intended method of inclusion via `<script>` tags in HTML or by running its dedicated build tool (`nodejs tools/foam.js`) to generate bundled files. Do not try to integrate it directly into projects using `import` or `require`.
affects: 0.5.0
gotchaThe project appears to be abandoned or no longer actively maintained, given its low version number (0.5.0), outdated documentation references (Google Groups), and absence of recent updates. This implies a lack of security patches, bug fixes, or compatibility updates for newer environments.
fix
Avoid using FOAM for new development. For critical legacy applications, be aware of the inherent risks related to unpatched vulnerabilities and potential instability in modern environments. Plan for eventual migration.
affects: 0.5.0
gotchaThe build process, described using a `nodejs tools/foam.js` command, is not integrated with modern front-end build pipelines (e.g., Webpack, Rollup, Vite). This can complicate integration into contemporary development workflows and dependency management.
fix
The build tool must be run separately as a command-line script. Integrating its output into modern build systems might require custom asset pipelines or manual steps to include the generated `foam.js` and `foam.html` files.
affects: 0.5.0
Errors
Common errors & fixes
Error: Cannot find module 'foam-framework'
Attempting to import or require `foam-framework` as a CommonJS or ESM module.
fix
FOAM is not designed for module imports. Load it via a script tag in HTML (`<script src="path/to/foam.js"></script>`) or use its dedicated build tools to generate deployable files.
ReferenceError: FOAM is not defined
The `FOAM` global object is not available because the framework's script was not loaded, or it was loaded incorrectly, or code is trying to access it before the script has executed.
fix
Ensure the `foam.js` script is correctly linked in your HTML (`<script src="path/to/foam.js"></script>`) and that any code accessing `FOAM` runs *after* the script has fully loaded and executed. Verify the path to `foam.js` is correct.
SyntaxError: Unexpected token '...' (or other modern JavaScript syntax errors)
Running FOAM's codebase or generated output in an environment (e.g., an older Node.js version or specific browser) that does not support the JavaScript features it uses, or conversely, running old FOAM code in a new environment without proper transpilation.
fix
Ensure the environment's JavaScript engine (browser or Node.js) is compatible with the version of JavaScript FOAM was written in. If using a newer environment, be aware that FOAM's code might contain deprecated patterns or lack support for modern syntax.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources