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 🙏

© 2026 – Pkg Stats / Ryan Hefner

emdash-lms

v0.1.0

Published

EmDash LMS — Subscriptions & Memberships plugin for EmDash CMS

Downloads

126

Readme

EmDash LMS

npm version License: MIT

A unified Learning Management System plugin for EmDash CMS. Build membership sites, online courses, or complete e-learning platforms.

Features

  • 3 Modes: Membership-only, LMS-only, or Full (combined)
  • Membership Plans: Subscription tiers with billing periods and access limits
  • Course Management: Courses with lessons, progress tracking, and certificates
  • Access Control: Membership-gated or individually purchasable courses
  • Simple Checkout: Built-in payment processing with multiple providers
  • Payment Providers: Stripe, Sepay (Vietnam), with extensible adapter pattern

Installation

pnpm add emdash-lms

Usage

// astro.config.mjs
import { defineConfig } from "astro/config";
import emdash from "emdash/astro";
import { lmsPlugin } from "emdash-lms";

export default defineConfig({
  integrations: [
    emdash({
      plugins: [
        lmsPlugin({
          mode: "full", // "membership" | "lms" | "full"
          currency: { base: "USD" },
          checkout: {
            enabled: true,
            providers: ["stripe", "sepay"],
          },
        }),
      ],
    }),
  ],
});

Configuration

Plugin Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | mode | "membership" \| "lms" \| "full" | "full" | Plugin mode | | membership.enabled | boolean | Based on mode | Enable membership features | | courses.enabled | boolean | Based on mode | Enable course features | | courses.individualPurchase | boolean | true | Allow buying courses individually | | checkout.enabled | boolean | true | Enable built-in checkout | | checkout.providers | string[] | [] | Payment providers to enable | | currency.base | string | "USD" | Base currency code (ISO 4217) |

Seed Data

Copy the appropriate seed file to bootstrap your LMS:

# Full mode (membership + courses)
cp node_modules/emdash-lms/seed/seed.json .emdash/seed.json

# Membership only
cp node_modules/emdash-lms/seed/membership.json .emdash/seed.json

# Courses only
cp node_modules/emdash-lms/seed/courses.json .emdash/seed.json

Admin Pages

| Page | Path | Description | |------|------|-------------| | Plans | /plans | Manage membership plans and pricing | | Members | /members | View active memberships | | Courses | /courses | Manage courses (via EmDash collections) | | Students | /students | Track enrollments and progress | | Orders | /orders | View purchase history | | Settings | /settings | Configure LMS and payment providers |

API Routes

All routes are prefixed with /_emdash/api/plugins/lms/

| Route | Description | |-------|-------------| | plans | CRUD operations for membership plans | | members | Manage user memberships | | orders | Order management | | checkout | Create and verify checkout sessions | | access | Check user access to courses/lessons | | webhook/:providerId | Payment provider webhooks |

Access Control

The plugin determines course access based on:

  1. Free courses - Always accessible
  2. Membership courses - Requires active membership with appropriate plan
  3. Purchase courses - Requires individual purchase
  4. Preview lessons - Always accessible regardless of access level
import { checkCourseAccess } from "emdash-lms";

const result = checkCourseAccess(course, userAccess, plans);
// { allowed: true, reason: "membership" }
// { allowed: false, deniedReason: "no_membership" }

Payment Providers

Stripe

lmsPlugin({
  checkout: {
    providers: ["stripe"],
  },
});

Required settings in admin:

  • test_secret_key / live_secret_key
  • webhook_secret
  • success_url / cancel_url

Sepay (Vietnam)

lmsPlugin({
  checkout: {
    providers: ["sepay"],
  },
});

Required settings:

  • api_key
  • checkout_page_url
  • webhook_secret (optional)

Custom Provider

import { registerProvider } from "emdash-lms";

registerProvider({
  id: "my-provider",
  name: "My Payment Provider",
  async createCheckout(order, config) {
    // Return { id, url, expires_at }
  },
  async handleWebhook(payload, headers, config) {
    // Return { event, orderId?, status? }
  },
  async verifyPayment(paymentId, config) {
    // Return { paid, status }
  },
});

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Watch mode
pnpm dev

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

Related

License

MIT © Tô Triều