@confuzzle/readpuz

1.2.3 • Public • Published

@confuzzle/readpuz

This package is for reading .puz format files. For a full reader, writer, and parser, see @confuzzle/puz-crossword.

Functionality

This package provides a single function readpuz(x), which runs Buffer.from(x), reads the .puz formatted contents of the buffer and returns an object according to the .puz file format as follows:

{
   title: "...",
   author: "...",
   copyright: "...",
   note: "...",
   width: 15,
   height: 15,
   clues: ["clue 1", "clue 2", ... ],
   solution: "ABC...",
   state: "A--...",
   hasState: true
}

hasState is a boolean indicating whether state is all blank squares (not part of the .puz format, provided for convenience).

Example Usage

const fs = require('fs');
const readpuz = require('@confuzzle/readpuz').readpuz;
const puz = readpuz(fs.readFileSync("test.puz"));

/@confuzzle/readpuz/

    Package Sidebar

    Install

    npm i @confuzzle/readpuz

    Weekly Downloads

    2

    Version

    1.2.3

    License

    MIT

    Unpacked Size

    4.71 kB

    Total Files

    3

    Last publish

    Collaborators

    • rjkat