JSPM

scribe-scroll

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q68973F
  • License MIT

Create and extract text from .docx files. Lightweight Node.js wrapper around the docx and mammoth libraries for programmatic document generation.

Package Exports

  • scribe-scroll
  • scribe-scroll/src/create.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scribe-scroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿ“œ scribe scrOll

Create, edit, and extract text from .docx files. One library, three scripts, zero fuss.

You've got documents to generate programmatically. Word files, reports, templates โ€” stuff that needs to exist but isn't a blog post or a config. scribe scrOll handles .docx creation, text editing, and content extraction with a minimal Node.js wrapper around the docx library.

Three commands. No Python. No LibreOffice. No Pandoc. Just node and npm.


What's inside

Script Purpose
src/create.js Create new .docx from text content with headings and paragraphs
src/extract.js Extract plain text or JSON from an existing .docx
(planned) Find-and-replace, append paragraphs, indexed edits

Install

npm install scribe-scroll
# or
npm install git+https://github.com/LittleJakub/scribe-scroll.git

Or use directly from source:

git clone https://github.com/LittleJakub/scribe-scroll.git
cd scribe-scroll
npm install

Usage

Create a document

node src/create.js \
  --title "My Report" \
  --content "Introduction\n\nThis is the body.\n\nConclusion" \
  --output report.docx

With headings (positions 1 and 3 become heading level 1):

node src/create.js \
  --title "Outline" \
  --content "Chapter 1\n\nDetails\n\nChapter 2\n\nDetails" \
  --heading-levels "1,3" \
  --output outline.docx

Extract text from a document

Plain text output:

node src/extract.js --input report.docx

JSON output (array of paragraph strings):

node src/extract.js --input report.docx --format json

Edit a document (planned)

Find and replace throughout:

node src/edit.js \
  --input old.docx \
  --find "Old Company Name" \
  --replace "New Company Name" \
  --output new.docx

Append a paragraph at the end:

node src/edit.js \
  --input doc.docx \
  --append "Added at the end" \
  --output doc.docx

Replace a specific paragraph (1-indexed):

node src/edit.js \
  --input doc.docx \
  --replace-index 2 \
  --text "Replaced paragraph 2" \
  --output doc.docx

Edit functionality planned for a future release.


Architecture

src/
  create.js    # Document creation via docx library
  extract.js   # Text extraction from .docx
  edit.js      # TODO: find/replace, append, indexed edits (requires read-capable .docx library)
package.json   # Dependencies and metadata
  • Dependencies: docx (MIT) for creation, mammoth.js (BSD-2-Clause) for extraction
  • No external tools: pure Node.js, no Python, no LibreOffice, no system dependencies
  • Node 18+: uses modern Node.js features

License

MIT โ€” see LICENSE for details.


Built by

Jakub ยท hiVe stack