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

@draftfirst/core

v0.1.0

Published

Draft First Screenwriting Engine for Fountain, FDX, deterministic pagination, and story-aware analysis.

Downloads

17

Readme

Draft First Screenwriting Engine

The Draft First Screenwriting Engine is a framework-free TypeScript library for screenplay documents. It parses and serializes Fountain, imports and exports a deliberately bounded FDX subset, paginates screenplay elements deterministically, and derives useful story context without sending a writer's work anywhere.

Draft First has been under development since November 2025. Version 0.1.0 is the first public package release.

npm install @draftfirst/core
import { parseFountain, serializeFountain, validateScreenplay } from '@draftfirst/core';
import { paginate } from '@draftfirst/core/layout';

const script = parseFountain(`INT. KITCHEN - NIGHT

MARA
We begin.`);

const validation = validateScreenplay(script);
if (!validation.ok) {
	console.error(validation.diagnostics);
}

const pages = paginate(script);
const fountain = serializeFountain(script);

Public modules

  • @draftfirst/core — document types, validation, and the stable Fountain API
  • @draftfirst/core/fountain — Fountain parsing, serialization, and normalization
  • @draftfirst/core/fdx — bounded, best-effort FDX interoperability
  • @draftfirst/core/layout — deterministic pagination and runtime estimates
  • @draftfirst/core/analysis — SmartType and continuity analysis
  • @draftfirst/core/editor — framework-free prediction and keyboard choreography

The Svelte editor used at draftfirst.xyz is not part of this package. The package contains no UI framework, network, storage, analytics, or runtime dependencies.

Compatibility contract

Draft First preserves screenplay text and reports unsupported or malformed input instead of silently claiming perfect compatibility. Fountain and FDX are richer than a single initial release can safely promise:

  • Fountain title pages, scenes, action, cues, dialogue, parentheticals, transitions, shots, centered text, lyrics, notes, sections, synopses, dual dialogue, scene numbers, and page breaks are supported.
  • FDX support focuses on paragraph content, common paragraph types, scene numbers, dual-dialogue markers, and title-page text. Formatting runs, production revisions, locked pages, macros, and arbitrary Final Draft metadata are not yet fidelity-preserving.
  • PDF generation is intentionally not exported in 0.1.0; correct Unicode font embedding and extraction must land before it becomes a public contract.

Keep the original file when importing an irreplaceable production document and review returned FDX diagnostics before replacing it.

Security and resource limits

The engine does not execute scripts, load external entities, access the network, or read files. Public parsers and validators enforce bounded input and return diagnostics for malformed data. Applications should still enforce their own file size limits before reading a user-selected file into memory.

Security reports should use GitHub's private vulnerability reporting for the Draft First repository.

Support

Draft First is ESM-only and supports Node.js 20 or newer and modern browsers. TypeScript declarations are included. The public API is pre-1.0 and may evolve through documented minor releases.

Draft First is not affiliated with or endorsed by Final Draft, Inc.

License

MIT © 2026 Yasir Dora.