Registry / devops / foso
library0.10.3jsnpmunverified

Foso is a convention-over-configuration JavaScript bundler, designed to simplify resource bundling with minimal setup. Originally conceived as an alternative to highly configurable task runners like Gulp or Grunt, Foso's core philosophy centers on zero-configuration operations. It automatically bundles resources using specific `fosify-*` plugins, watches for file changes to trigger re-bundling, includes a LiveReload server for automatic browser refreshes, and can optionally serve bundled assets via a static server. The system leverages naming conventions (e.g., `bundle.js`, `[something].bundle.js`) to determine how files are processed and outputted. The current and likely final stable version is 0.10.3, with development having ceased approximately seven years ago, indicating it is no longer actively maintained. Its primary differentiators were its simplicity and opinionated conventions to reduce boilerplate configuration.

npm install foso
INSTALL
IMPORT
SIG · FOSO
F
foso
devopsjavascriptv0.10.3
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.

foso
const foso = require('foso');
import foso from 'foso';
Foso is a CommonJS-only package. Direct ESM `import` statements are not supported.
fosify-less
const lessPlugin = require('fosify-less');
import lessPlugin from 'fosify-less';
Plugins like 'fosify-less' are also CommonJS modules and must be imported using `require()`.

This example demonstrates how to set up and initiate a Foso bundling process programmatically, registering the `fosify-less` plugin. It creates temporary source and destination directories to illustrate the convention-based file handling.

const Foso = require('foso'); const lessPlugin = require('fosify-less'); const path = require('path'); const fs = require('fs'); // Create dummy source files for the example const srcDir = path.join(__dirname, 'src', 'styles'); const destDir = path.join(__dirname, 'dist'); fs.mkdirSync(srcDir, { recursive: true }); fs.mkdirSync(destDir, { recursive: true }); fs.writeFileSync(path.join(srcDir, 'main.bundle.less'), 'body { color: red; }'); const foso = new Foso(); foso .register(lessPlugin, { src: path.join(__dirname, 'src'), dest: destDir, watch: false, // Set to true for live reloading, but requires a running process minify: false }) .then(() => { console.log('Foso bundle command initiated. Checking for bundled files...'); // In a real scenario, you'd call foso.bundle() or foso.serve() // For this quickstart, we're demonstrating setup. // Simulating completion since actual bundling needs fosify-less to run and write files. console.log(`Please check the '${destDir}' directory for bundled output if 'fosify-less' was properly configured and executed.`); console.log('Foso setup complete. Actual bundling would happen now.'); }) .catch(err => { console.error('Foso initialization failed:', err); }); // Clean up dummy files after a short delay (for demonstration purposes) setTimeout(() => { try { fs.rmSync(path.join(__dirname, 'src'), { recursive: true, force: true }); fs.rmSync(destDir, { recursive: true, force: true }); console.log('Cleaned up dummy files.'); } catch (e) { console.error('Error cleaning up:', e); } }, 3000);
foso --version
Debug
Known issues
breakingThe `foso` project and its associated `fosify-*` plugins have not been updated in approximately 7 years. This means it is no longer actively maintained, receives no security patches, and is likely incompatible with modern Node.js versions and ecosystem tools. Using it in new projects or maintaining it in existing ones is highly discouraged.
fix
Migrate to a modern, actively maintained bundler like Webpack, Rollup, Vite, or Parcel. These tools offer better performance, feature sets, and security.
affects: >=0.10.3
gotcha`foso` is a CommonJS-only package. Attempting to use `import` statements (ESM syntax) directly with `foso` or its plugins in a modern JavaScript module environment will result in errors.
fix
If integrating into an ESM project, you must use `require()` within a CommonJS context or transpile your code, or use dynamic `import()` if Node.js runtime supports it and the module is compatible. It is generally safer to assume CommonJS-only usage.
affects: All versions
gotchaFor CLI usage, Foso and its plugins (`fosify-js`, `fosify-less`, etc.) require global installation via `npm install -g`. This approach to dependency management is generally discouraged in modern Node.js development in favor of local project dependencies and `npx`.
fix
If you must use `foso` CLI, perform `npm install -g foso` and `npm install -g fosify-js fosify-less fosify-html`. However, reconsidering the project's abandoned status and global dependency model is advisable.
affects: All versions
Errors
Common errors & fixes
Error: Cannot find module 'foso'
The `foso` package was not installed or is not accessible from the current working directory or Node.js module resolution path.
fix
Run `npm install foso` in your project directory for local usage, or `npm install -g foso` for global CLI usage.
ReferenceError: require is not defined in ES module scope
Attempting to use `require('foso')` within an ECMAScript Module (ESM) file (`.mjs` or when `type: "module"` in `package.json`). Foso is a CommonJS module.
fix
Ensure your file is treated as a CommonJS module (e.g., using a `.js` extension without `type: "module"` in `package.json`), or use a compatibility layer if necessary. The recommended long-term solution is migrating to a modern bundler that supports ESM.
foso: command not found
The `foso` CLI was not installed globally or its installation path is not in your system's PATH environment variable.
fix
Install `foso` globally using `npm install -g foso`. Verify installation by running `foso --version` (if supported) or checking npm global binaries.
Upgrade
Version history
0.10.3latest on npm
Audit
Dependencies
fosify-jsoptionalRequired for JavaScript bundling functionality.
fosify-lessoptionalRequired for Less CSS preprocessor bundling functionality.
fosify-sassoptionalRequired for Sass CSS preprocessor bundling functionality.
fosify-htmloptionalRequired for HTML bundling functionality.
fosify-testoptionalRequired for test-related bundling functionality.
Agent activity
2 hits · last 30 days
node
2
Resources