Registry / communication / castle-email-lib

castle-email-lib

JSON →
library2.5.0jsnpmunverified

A library for building emails with React, version 2.5.0. Provides components and utilities to create responsive, template-based emails using React, simplifying the process of generating HTML emails. It emphasizes a component-based approach, allowing reuse and composition, and integrates with common email sending services. Key differentiators include a focus on React developers familiar with JSX, reducing the need for traditional email template languages. Currently stable with regular updates.

npm install castle-email-lib
INSTALL
IMPORT
SIG · CASTLE-EMAIL-LIB
C
castle-email-lib
communicationjavascriptv2.5.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CastleEmail
✓ import { CastleEmail } from 'castle-email-lib'
✗ const { CastleEmail } = require('castle-email-lib')
ESM only; CJS not supported
EmailRenderer
✓ import { EmailRenderer } from 'castle-email-lib/renderer'
✗ import EmailRenderer from 'castle-email-lib'
Export from subpath; default export is not available.
Template
✓ import { Template } from 'castle-email-lib/templates'
✗ import Template from 'castle-email-lib/templates'
Named export only.

Shows basic usage of CastleEmail component and EmailRenderer to generate email HTML.

import { CastleEmail, EmailRenderer } from 'castle-email-lib'; import React from 'react'; const MyEmail = () => ( <CastleEmail> <h1>Hello World</h1> </CastleEmail> ); const renderer = new EmailRenderer(); const html = renderer.render(<MyEmail />); console.log(html);
Debug
Known issues
breakingVersion 2.0.0 changed the import paths from root to subpaths.
fix
Update imports: `import { CastleEmail } from 'castle-email-lib'` and subpath imports for additional exports.
affects: >=2.0.0
deprecatedThe default export was removed in v2.0.0.
fix
Use named imports instead.
affects: >=2.0.0
gotchaEmailRenderer expects JSX element, not component class or string.
fix
Always pass a React element, e.g., `renderer.render(<MyComponent />)`.
affects: all
breakingCJS support dropped in v2.0.0, only ESM is supported.
fix
Use ESM imports or upgrade build system.
affects: >=2.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'castle-email-lib'
Missing package install or incorrect import path.
fix
Run `npm install castle-email-lib` and use correct import: `import { CastleEmail } from 'castle-email-lib'`.
Uncaught TypeError: castle_email_lib_1.CastleEmail is not a constructor
Using default import for non-default export.
fix
Use named import: `import { CastleEmail } from 'castle-email-lib'`.
CastleEmail is not defined
Undefined symbol in scope, likely due to import error or missing peer dependency.
fix
Ensure React is installed and import CastleEmail correctly.
Upgrade
Version history
2.5.0latest on npm
Audit
Dependencies
reactrequiredpeer dependency for rendering components
Agent activity
37 hits · last 30 days
node
34
OpenAI (training)
1
Resources
castle-email-lib — npm install castle-email-lib · libregistry