# @mashroom-content/mashroom-content-asset-processing

> Mashroom Content Asset services

Latest version **1.0.4** (published 2025-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mashroom-content/mashroom-content-asset-processing
pnpm add @mashroom-content/mashroom-content-asset-processing
yarn add @mashroom-content/mashroom-content-asset-processing
bun add @mashroom-content/mashroom-content-asset-processing
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2025-06-11 |
| First published | 2022-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 17.3 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | jkofler |

## Links

- npm: https://www.npmjs.com/package/@mashroom-content/mashroom-content-asset-processing
- Repository: https://github.com/nonblocking/mashroom-content
- Homepage: https://www.mashroom-server.com
- Issues: https://github.com/nonblocking/mashroom-content/issues
- npm.io page: https://npm.io/package/@mashroom-content/mashroom-content-asset-processing

## Dependencies (4)

- [sharp](https://npm.io/package/sharp.md) ^0.33.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.3.0
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.35
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.7.0

## Recent versions

- 1.0.4 (latest) — 2025-06-11
- 1.0.0-alpha.5 (next) — 2022-11-07
- 1.0.3 — 2023-07-28
- 1.0.2 — 2022-12-28
- 1.0.1 — 2022-12-28
- 1.0.0 — 2022-12-28
- 1.0.0-alpha.4 — 2022-04-27
- 1.0.0-alpha.3 — 2022-04-25
- 1.0.0-alpha.2 — 2022-04-25
- 1.0.0-alpha.1 — 2022-04-20
- 1.0.0-alpha.0 — 2022-04-20

## README

# Mashroom Content Assets

Plugin for [Mashroom Server](https://www.mashroom-server.com), a **Microfrontend Integration Platform**.
Part of the [Mashroom Content](https://github.com/nonblocking/mashroom) extension.

This plugin adds a service to fetch and process assets (e.g. image conversion).

## Usage

If *node_modules/@mashroom* is configured as plugin path just add **@mashroom-content/mashroom-content-asset-processing** as *dependency*.

You can override the default config in your Mashroom config file like this:

```json
{
    "plugins": {
        "Mashroom Content Asset Processing Services": {
            "scaleUp": false,
            "defaultQuality": 75,
            "cacheEnable": true,
            "cacheDefaultTTLSec": 31536000,
            "cacheFolder": "./data/asset-proc-cache"
        }
    }
}
```

* _scaleUp_: Scale images up (Default: false)
* _defaultQuality_: Default image conversion quality (Default: 75)
* _cacheEnable_: Enable asset cache (Default: true)
* _cacheDefaultTTLSec_: Asset cache TTL in seconds (Default: 31536000)
* _cacheFolder_: Cache folder (Default: ./data/asset-proc-cache)

### Service

On the Server side you can use the following new service accessible through _pluginContext.services.assetProc.service_:

```ts
export interface MashroomContentAssetProcService {
    /**
     * Process and return given asset from URI - result will be cached
     */
    processAssetFromUri(assetUri: string, resize?: MashroomContentAssetProcImageResize, convert?: MashroomContentAssetProcImageConvert): Promise<MashroomContentAssetProc>;

    /**
     * Process given asset
     */
    processAsset(asset: Readable, resize?: MashroomContentAssetProcImageResize, convert?: MashroomContentAssetProcImageConvert): Promise<Readable>;
}
```

---
_Source: https://npm.io/package/@mashroom-content/mashroom-content-asset-processing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
