npm install email-template-object or yarn add email-template-object
Built with TypeScript, bundled with tsup, tested with Vitest.
- A tree like structure for rendering components in a "recursive" way
- Ability to add checks and return errors
- An
isErrorflag to understand if everything is ok - Be able to return data
- Merge with previous test cases
- Better handling of subcomponents
- Have a template object that can also be used as source
npm install
npm run build # uses tsup
npm test # uses vitest
npm run typecheck # tsc --noEmit
npm run dev # tsup in watch modedist/index.js— ESMdist/index.cjs— CommonJSdist/index.global.js— IIFE (browser)dist/index.d.ts— TypeScript declarations
import { factoryFour } from 'email-template-object';
const settings = {
component: (params: any) => `Hello ${params.name}`,
params: { name: 'World' }
};
const factory = factoryFour(settings);
console.log(factory.display());