1.0.3 • Published 10 months ago

@mashroom-content/mashroom-content-asset-processing v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Mashroom Content Assets

Plugin for Mashroom Server, a Microfrontend Integration Platform. Part of the Mashroom Content 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:

{
    "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:

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>;
}
1.0.3

10 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-alpha.5

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-alpha.0

2 years ago