UNPKG

@nutrient-sdk/node

Version:

Convert documents in your Node.js apps.

13 lines 1.1 kB
/*! * Nutrient for Node.js 1.1.0 (https://www.nutrient.io/nodejs) * * Copyright © 2024-2025 PSPDFKit GmbH. All rights reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. * * Nutrient uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/nodejs-acknowledgements/ */ import{dotnet as t}from"./dotnet.js";export async function initDotnet(e,i){if(null===e||"string"!=typeof e||0===e.trim().length)throw Error("`baseUrl` must be a string passed to `initDotnet` and be non-empty.");let{getAssemblyExports:a,getConfig:r,Module:n}=await t.withConfig({locateFile:t=>`${e}/${t}`}).withResourceLoader(i).create();globalThis.gdPicture={module:n,baseUrl:e};let o=await a(r().mainAssemblyName);return await o.GdPictureWasm.API.Initialize(),{Assemblies:o,Module:n,BaseUrl:e}}