Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Mashroom Content Asset services

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 28 Jul 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc