Skip to main content
Follow the instructions below to install TemplateDX in your app.

Install TemplateDX

Install with npm:
npm
npm install @agentmark-ai/templatedx
or yarn:
npm
yarn add @agentmark-ai/templatedx

Use TemplateDX

import { transform, stringify } from '@agentmark-ai/templatedx';
import MyTemplate from './my-template.mdx';
...
const props = { name: 'Jim' };
const result = stringify(await transform(MyTemplate, props));

Node

import { transform, stringify, load } from '@agentmark-ai/templatedx';

const run = async () => {
  const mdx = await load('./example.mdx');
  const props = { name: 'Jim' };
  return stringify(await transform(mdx, props));
}
run();