### Install Typst.ts package Source: https://www.npmjs.com/package/@myriaddreamin/typst.ts/package/%40myriaddreamin/typst Command to install the Typst.ts npm package using npm. This is the primary method for including the Typst.ts library in your project. ```bash npm i @myriaddreamin/typst.ts ``` -------------------------------- ### Generate SVG with Typst.ts Source: https://www.npmjs.com/package/@myriaddreamin/typst.ts/package/%40myriaddreamin/typst_activetab=readme This code snippet demonstrates how to import and use the $typst function from the @myriaddreamin/typst.ts package to generate SVG output from Typst markup. It takes `mainContent` as input and returns the length of the generated SVG string. ```typescript import { $typst } from '@myriaddreamin/typst.ts'; console.log( ( await $typst.svg({ mainContent: 'Hello, typst!', }) ).length, ); // :-> 7317 ``` -------------------------------- ### Generate SVG from Typst Content using $typst.svg Source: https://www.npmjs.com/package/@myriaddreamin/typst.ts/package/%40myriaddreamin/typst_activetab=versions This snippet demonstrates how to use the $typst.svg function from the @myriaddreamin/typst.ts package to convert Typst markup into an SVG string. It requires the Typst.ts library to be imported. The function takes an object with a `mainContent` property and returns the SVG content's length. ```typescript import { $typst } from '@myriaddreamin/typst.ts'; console.log( ( await $typst.svg({ mainContent: 'Hello, typst!', }) ).length, ); // :-> 7317 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.