@dudadev/duda-migration-utils

    1.0.0 • Public • Published

    duda-migration-utils

    Setup

    npm install @dudadev/duda-migration-utils

    API

    getDomainUrl

    Usage example:

    const { getDomainUrl } = require('@dudadev/duda-migration-utils');
    
    const domainUrl = await getDomainUrl(zipModifier);

    addImages

    Usage example:

    const { addImages } = require('@dudadev/duda-migration-utils');
    
    await zipModifier.modifyFiles(/\.html$/, async (content) => {
      const imagesRegex = /https\:\/\/.*?\.(jpg|png|jpeg|gif)/gi;
      const images = content.match(imagesRegex);
    
      return addImages(zipModifier, {
        content,
        images,
        baseUrl: 'https://my-domain.com'
      });
    });

    addNewFile

    Usage example:

    const { addNewFile } = require('@dudadev/duda-migration-utils');
    
    const { body: content } = await fetch(imageUrl);
    await addNewFile(zipModifier, {
      content,
      path: `images/${fileName}`,
      newTxtFields: { URL: imageUrl }
    });

    Keywords

    none

    Install

    npm i @dudadev/duda-migration-utils

    DownloadsWeekly Downloads

    4

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.27 kB

    Total Files

    3

    Last publish

    Collaborators

    • russjeffery
    • yoavporat
    • liady
    • idanen
    • hilakerer
    • sharon_rub
    • talkor
    • dannyr-duda
    • shira.weiss
    • roiekoper-duda
    • everett-duda