UNPKG
bookiza
Version:
beta (1.0.0-beta.10)
beta.1 (1.0.0-beta.1)
latest (5.1.0)
5.1.0
5.0.0
4.2.1
4.2.0
4.1.0
4.0.0
3.0.2
2.10.18
2.10.17
2.9.15
2.8.15
1.8.15
1.7.15
1.7.14
1.6.13
1.5.12
1.4.11
1.3.11
1.3.10
1.3.9
1.2.9
1.1.9
1.1.8
1.1.7
1.1.6
1.1.5
1.1.3
1.1.2
1.0.2
1.0.1
1.0.0-beta.10
1.0.0-beta.9
1.0.0-beta.7
1.0.0-beta.6
1.0.0-beta.5
1.0.0-beta.4
1.0.0-beta.3
1.0.0-beta.2
1.0.0-beta.1
1.0.0-beta.0
0.1.1
0.1.0
0.0.50
0.0.1-security
The book reification framework for the web
bookiza.io
bookiza/bookiza.cli
bookiza
/
lib
/
bookLength.js
13 lines
(10 loc)
•
278 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
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
; }