JSPM

@zhanjian/shared

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q29237F
  • License MIT

Shared types and utilities for the Zhanjian ecosystem.

Package Exports

  • @zhanjian/shared
  • @zhanjian/shared/cvs
  • @zhanjian/shared/privacy
  • @zhanjian/shared/types
  • @zhanjian/shared/utils

Readme

@zhanjian/shared

Shared types and utilities for the Zhanjian ecosystem (CLI, worker, web).

Exports

Subpath Contents
@zhanjian/shared Re-exports from types, utils, privacy, cvs
@zhanjian/shared/types Domain types: Post, User, PostType, FeedQuery, CreatePostInput, ApiError, etc.
@zhanjian/shared/cvs CVS (Content Value Score): CVSInput, CVSResult, calculateCVS
@zhanjian/shared/utils Markdown: calculateEffectiveChars, extractCodeBlocks, calculateCodeRatio; templates: TEMPLATES, getTemplate, validateTemplate, generateSkeleton
@zhanjian/shared/privacy Privacy checks: scanContent, PrivacyIssue, PrivacyIssueType

Usage

In another package (e.g. CLI or worker):

{
  "dependencies": {
    "@zhanjian/shared": "workspace:*"
  }
}
import { PostType, type Post } from "@zhanjian/shared";
import { calculateCVS } from "@zhanjian/shared/cvs";
import { scanContent } from "@zhanjian/shared/privacy";
import { calculateEffectiveChars } from "@zhanjian/shared/utils";

Development

From the monorepo root:

pnpm --filter @zhanjian/shared build
pnpm --filter @zhanjian/shared test

Repository

Part of zhan-cli. See root README for full project info.