Registry / web-framework / felt

felt

JSON →
library0.3.2jsnpmunverified

Felt is an on-demand bundler designed for modern JavaScript (ES6 and beyond, typically transpiled via Buble/Rollup) and CSS (CSS Next), serving primarily as a development middleware or a static asset exporter. Currently at version 0.3.2, it requires Node.js 6 or above to run. The package offers three main modes of operation: a standalone CLI web server for quick local development, an Express.js middleware for integration into existing Node.js applications, and a static file exporter for pre-compiling assets for deployment. Its core functionality is highly extensible through 'recipes' and a plugin architecture, exemplified by modules like `felt-rollup`, which allows developers to define custom handler logic for different file types. This on-demand compilation approach is a key differentiator, focusing on speed during development rather than exhaustive pre-bundling.

web-frameworkdevops
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.

Felt is a CommonJS module, primarily used with `require()`. There is no native ESM support.

const felt = require('felt')

Recipes like `felt-recipe-minimal` are separate CommonJS modules that `felt` consumes. Do not use ES module `import` syntax.

const recipe = require('felt-recipe-minimal')

Configuration files are expected to be CommonJS modules exporting an object, typically required relative to the application's entry point.

const config = require('./felt.config.js')

Integrates Felt as an on-demand ES6/CSS bundler middleware with an Express.js server.

const express = require('express'); const felt = require('felt'); const path = require('path'); const config = require('./felt.config.js'); // Assuming felt.config.js exists and exports a Felt config object const app = express(); // Integrate Felt as an on-demand bundling middleware app.use(felt(config)); // Serve static files from the 'public' directory app.use(express.static(path.join(__dirname, 'public'))); const PORT = process.env.PORT ?? 3000; app.listen(PORT, () => { console.log(`Felt server running at http://localhost:${PORT}`); console.log('Serving static files from ./public and bundling JavaScript/CSS on-demand.'); }); // To set up: // 1. npm install express felt felt-rollup rollup-plugin-buble rollup-plugin-node-resolve rollup-plugin-commonjs // 2. Create 'felt.config.js' (as shown in the README example) // 3. Create 'public/index.html' and 'public/main.js' (e.g., 'console.log("Hello from Felt!")') // 4. Run with 'node server.js'
felt --version
Debug
Known footguns
breakingFelt is a CommonJS-only package. Attempting to use `import` statements directly in an ES module environment will result in runtime errors. It predates widespread native ESM support in Node.js.
gotchaFelt itself does not bundle files out of the box; it requires 'recipes' (like `felt-recipe-minimal`) or custom `handlers` specified in its configuration to define how different file types (e.g., `.js`, `.css`) are processed.
gotchaFelt explicitly requires Node.js 6.x or above. While it may run on newer versions, its older dependencies (e.g., Rollup 0.x, Buble) might lead to compatibility issues or missing features compared to modern bundling setups.
gotchaFelt's 'on-demand' bundling means assets are compiled dynamically upon request. This is great for development hot-reloading but can introduce latency for initial requests or heavy load in production environments compared to pre-compiled static assets.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
14 hits · last 30 days
gptbot
4
ahrefsbot
4
claudebot
4
script
1
bingbot
1
Resources