Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
67
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Mashroom Content Asset services


Version published
Maintainers
1
Install size
19.5 MB
Created

Readme

Source

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

FAQs

Last updated on 28 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc