UNPKG

bookiza

Version:

The book reification framework for the web

13 lines (10 loc) 278 B
import { readdirSync } from 'fs'; export default function bookLength() { const pages = (source) => readdirSync(source, { withFileTypes: true, }).reduce((a, c) => { c.isDirectory() && a.push(c.name); return a; }, []); return pages('./manuscript').length; }