UNPKG

@altano/html-cdnify

Version:

Transform the relative URLs in your HTML markup (e.g. scripts, stylesheets, images) to use your CDN URL.

18 lines (16 loc) 629 B
import { CDNTransformer } from "./CDNTransformer.js"; import streamifier from "streamifier"; //#region src/cdnify.ts /** * Alternative wrapper for simple Promise-based use of library (as opposed to transform stream) */ function cdnify(options) { if (typeof options.buffer !== "string") options.buffer = options.buffer.toString(); const cdnTransformer = new CDNTransformer(options); streamifier.createReadStream(options.buffer).pipe(cdnTransformer.stream); return cdnTransformer.outputBufferPromise; } var cdnify_default = cdnify; //#endregion export { cdnify, cdnify_default as default }; //# sourceMappingURL=cdnify.js.map