npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@oiper/email-core

v0.0.6

Published

A comprehensive email core package for [Oiper.com](https://oiper.com) that provides email compilation, schema validation, and rendering capabilities. This package is designed to be used as a foundation for email-related applications and services.

Readme

@oiper/email-core

A comprehensive email core package for Oiper.com that provides email compilation, schema validation, and rendering capabilities. This package is designed to be used as a foundation for email-related applications and services.

Overview

@oiper/email-core is not intended for direct use in creating email editors, but rather serves as a core infrastructure package that enables:

  • Email Compilation: Transform email node structures into rendered HTML
  • Schema Validation: Verify email structures using Zod schemas
  • Email Rendering: Render email components with React Email
  • Type Safety: Full TypeScript support with comprehensive type definitions

Features

🏗️ Email Node System

  • Structured Components: Row, Column, Section layouts
  • Content Elements: Text, Button, Heading, Image, Spacer
  • Rich Content: HTML, Markdown, and Code blocks with syntax highlighting
  • Responsive Design: Mobile/desktop visibility controls and responsive layouts

✅ Schema Validation

  • Zod Integration: Comprehensive validation using Zod schemas
  • Type Safety: Full TypeScript support with discriminated unions
  • Runtime Validation: Verify email structures at runtime

🎨 Rendering Engine

  • React Email: Built on top of React Email components
  • Customizable: Configurable rendering with editor integration
  • Flexible Output: Support for both full HTML and component-only rendering

🛠️ Developer Tools

  • Live Templates: Development server for testing email templates
  • Helper Functions: Utilities for node manipulation and path resolution
  • Comprehensive Types: Detailed TypeScript definitions for all components

Installation

# npm
npm install @oiper/email-core

# yarn
yarn add @oiper/email-core

# pnpm
pnpm add @oiper/email-core

# bun
bun add @oiper/email-core

Environment Support

This package is designed to work in both browser and Node.js environments:

  • Browser: Full support for client-side rendering and validation
  • Node.js: Complete functionality for server-side processing
  • ⚠️ Edge Runtime: Not recommended due to React Email dependencies and DOM requirements

Usage

Basic Email Rendering

import { RenderEmail } from '@oiper/email-core'

const emailData = [
  {
    type: 'TEXT',
    content: 'Hello World',
    textAlign: 'center',
    containerPaddingTop: 10,
    containerPaddingBottom: 10,
  },
  {
    type: 'BUTTON',
    content: 'Click Me',
    linkHref: 'https://example.com',
    textAlign: 'center',
  },
]

const emailComponent = (
  <RenderEmail
    body={emailData}
    mode="detailed"
    config={{ maxWidth: '768px' }}
  />
)

Schema Validation

import { zodEmailNodeSchema } from '@oiper/email-core'

function validateEmail(data: unknown) {
  try {
    const validated = zodEmailNodeSchema.parse(data)
    return { success: true, data: validated }
  } catch (error) {
    return { success: false, error }
  }
}

Working with Email Nodes

import { emailNodeHelpers } from '@oiper/email-core'

// Get node paths
const paths = emailNodeHelpers.getPath(node, targetNode)

// Delete nodes
const updatedNodes = emailNodeHelpers.deleteNode(nodes, path)

Component Types

Layout Components

  • Row: Horizontal layout container with columns
  • Column: Vertical layout container within rows
  • Section: Content grouping container

Content Components

  • Text: Simple text content with styling
  • Button: Interactive button elements
  • Heading: Text headings (h1-h6)
  • Image: Image elements with responsive sizing
  • Spacer: Vertical spacing elements

Rich Content

  • HTML: Raw HTML content
  • Markdown: Markdown-formatted content
  • Code: Syntax-highlighted code blocks

Development

Running Tests

npm test

Test Coverage: This package includes comprehensive test coverage for all core functionality, including email node schemas, rendering components, and helper functions.

Development Server

npm run live:template

Building

npm run build

Contributing

This package is part of the Oiper.com ecosystem. For contributions, please refer to the project's contribution guidelines.

License

Private package - All rights reserved by Oiper.com

NOTE:

Current Status: This package is not yet ready for public use.

Future Plans: This package will be published as open source with an open license in the future.