Package Exports
- @confuzzle/readpuz
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 (@confuzzle/readpuz) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@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"));