PHPackages                             carbon/fileloader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. carbon/fileloader

ActiveNeos-carbon[File &amp; Storage](/categories/file-storage)

carbon/fileloader
=================

Load files for components in Flow and Neos CMS

0.1.11(2mo ago)013.4k↓31.4%24GPL-3.0-or-laterTypeScriptCI failing

Since Feb 13Pushed 2w ago1 watchersCompare

[ Source](https://github.com/CarbonPackages/Carbon.FileLoader)[ Packagist](https://packagist.org/packages/carbon/fileloader)[ RSS](/packages/carbon-fileloader/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (3)Versions (15)Used By (4)

Carbon.FileLoader Package for Neos CMS
======================================

[](#carbonfileloader-package-for-neos-cms)

Load JavaScript and CSS assets from Neos/Flow packages via Fusion.

Carbon.FileLoader supports two strategies:

- `tags`: render `` / `` tags directly in markup.
- `attributes`: render `data-*` attributes and load assets with the included `Loader.js`.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require carbon/fileloader
```

Fusion auto-include and the Eel helper context are registered automatically via package settings.

Default Configuration
---------------------

[](#default-configuration)

```
Carbon:
  FileLoader:
    strategy: tags
    hashLength: 8
    debug: false
    removeLocalhost: true
```

### Option Reference

[](#option-reference)

- `strategy`: `tags` or `attributes`.
- `hashLength`: length of the cache-busting hash (`h=...`) appended to generated file URLs. Set `0`, `false` or `null` to disable.
- `debug`: enables verbose browser console output for the `attributes` strategy.
- `removeLocalhost`: rewrites `http://localhost/...` and `https://localhost/...` to `/...`.

Basic Fusion Usage
------------------

[](#basic-fusion-usage)

Use the high-level component:

```
assets = Carbon.FileLoader:Component {
    package = 'Vendor.Site'
    css = 'Main.css'
    js = 'App.js'
    mjs = 'Hydration.js'
}

```

### Available Properties (`Carbon.FileLoader:Component`)

[](#available-properties-carbonfileloadercomponent)

- `strategy`: `tags` or `attributes` (defaults to `Carbon.FileLoader.strategy`).
- `inline`: inline content instead of external URLs. Forces `tags` strategy.
- `package`: package key (required unless absolute/resource URL is provided in filenames).
- `js`, `css`, `mjs`: string, comma-separated string, or array.
- `neverIncludeJS`, `neverIncludeCSS`, `neverIncludeMJS`: disable one asset type.
- `jsFolder`, `cssFolder`, `mjsFolder`: relative folder in `Public/`.
- `scriptExecution`: `defer`, `async`, or `null`.
- `eventOnLoad`: custom event name (attributes strategy only).
- `useCache`: loader cache for runtime loading (attributes strategy only).
- `debug`: runtime console debug output (attributes strategy only).
- `slipstream`, `slipstreamPrepend`: optional Sitegeist.Slipstream integration (tags strategy).

Strategy: `tags`
----------------

[](#strategy-tags)

Renders final HTML tags directly.

```
assets = Carbon.FileLoader:Strategy.Tags {
    package = 'Vendor.Site'
    css = ['Main.css', 'Print.css']
    js = ['Vendor.js', 'App.js']
    mjs = 'Hydration.js'
    scriptExecution = 'defer'
}

```

Use this strategy if you want classic server-rendered asset tags.

Strategy: `attributes`
----------------------

[](#strategy-attributes)

Renders `data-*` attributes that are interpreted by `Loader.js` in the browser.

```
assets = Carbon.FileLoader:Strategy.Attributes {
    package = 'Vendor.Site'
    css = 'Main.css'
    js = 'App.js'
    mjs = 'Hydration.js'
    scriptExecution = 'defer'
    eventOnLoad = 'assets:loaded'
    useCache = true
}

```

When using this strategy, include and execute the client-side loader:

```

  import { initLoader } from "/_Resources/Static/Packages/Carbon.FileLoader/Modules/Loader.min.js";
  initLoader();

```

You can call `initLoader({ rootElement })` again after replacing or appending dynamic markup.

Helper Prototypes
-----------------

[](#helper-prototypes)

### `Carbon.FileLoader:Helper.File`

[](#carbonfileloaderhelperfile)

Resolve one file:

```
singleFile = Carbon.FileLoader:Helper.File {
    package = 'Vendor.Site'
    folder = 'Scripts/'
    file = 'App.js'
}

```

### `Carbon.FileLoader:Helper.FileItems`

[](#carbonfileloaderhelperfileitems)

Resolve multiple files:

```
multipleFiles = Carbon.FileLoader:Helper.FileItems {
    package = 'Vendor.Site'
    folder = 'Styles/'
    items = ['Main.css', 'Print.css']
}

```

Eel Helper API (`Carbon.FileLoader.*`)
--------------------------------------

[](#eel-helper-api-carbonfileloader)

Registered in Fusion default context as `Carbon.FileLoader`.

- `filter(value)`: normalize string/array input into a cleaned array.
- `uri(uri, inline = false, package = null, folder = null, hashLength = null)`: resolve one URL or inline content.
- `uris(arrayOrString)`: resolve many URLs and join them with commas.
- `encodeUrl(string)`: Base64 URL-safe encoding (used by attributes strategy).

Path Resolution Rules
---------------------

[](#path-resolution-rules)

- If `file` contains `//` (for example `https://...` or `resource://...`), it is used as-is.
- Otherwise, the file is resolved via:

```
resource:///Public/

```

- For external files, only URL generation is used.
- For inline mode, file content is loaded directly.

JavaScript Utilities
--------------------

[](#javascript-utilities)

The package ships ready-to-use browser modules in `Resources/Public/Modules/`:

- `Loader.js` / `Loader.min.js`
- `EventDispatcher.js` / `EventDispatcher.min.js`
- `EventListener.js` / `EventListener.min.js`

Development
-----------

[](#development)

Install dependencies:

```
pnpm install
```

Build assets:

```
pnpm build
```

Watch mode:

```
pnpm watch
```

Alternative via Makefile:

```
make production
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance91

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~90 days

Total

12

Last Release

73d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fec51ac160a110a31a72a54ac29e276a447d8306205a052d35491ac9cf0589b?d=identicon)[jonnitto](/maintainers/jonnitto)

---

Top Contributors

[![jonnitto](https://avatars.githubusercontent.com/u/4510166?v=4)](https://github.com/jonnitto "jonnitto (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![markusguenther](https://avatars.githubusercontent.com/u/1014126?v=4)](https://github.com/markusguenther "markusguenther (1 commits)")[![mhsdesign](https://avatars.githubusercontent.com/u/85400359?v=4)](https://github.com/mhsdesign "mhsdesign (1 commits)")[![so-grimm](https://avatars.githubusercontent.com/u/119854907?v=4)](https://github.com/so-grimm "so-grimm (1 commits)")

---

Tags

carbonneoscmsflowNeosneoscms

### Embed Badge

![Health badge](/badges/carbon-fileloader/health.svg)

```
[![Health](https://phpackages.com/badges/carbon-fileloader/health.svg)](https://phpackages.com/packages/carbon-fileloader)
```

###  Alternatives

[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2481.6M15](/packages/flowjs-flow-php-server)[shel/neos-hyphens

A plugin for Neos CMS which provides hyphens for the inline editor

21214.3k1](/packages/shel-neos-hyphens)[shel/nodetypes-analyzer

Graphical analysis &amp; visualizer for the Neos CMS nodetypes as backend module

2165.2k](/packages/shel-nodetypes-analyzer)[shel/neos-colorpicker

A plugin for Neos CMS which provides a colorpicker editor

14104.7k6](/packages/shel-neos-colorpicker)[dl/assetsync

Sync files from various sources to neos assets.

1021.8k](/packages/dl-assetsync)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
