npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

slf-parser

v0.1.0

Published

Parses Go diagrams

Readme

slf-parser

A Node library for parsing Go diagrams in Sensei's Library Format.

Example

import { toBoard } from "slf-parser";

const diagram =
`$$ A joseki variation
 $$  ------------------
 $$ | . . . . . . . . .
 $$ | . . . . . . . . .
 $$ | . . 7 3 X d . . .
 $$ | . . O 1 O 6 . . .
 $$ | . . 4 2 5 c . . .
 $$ | . . 8 X a . . . .
 $$ | . . . b . . . . .
 $$ | . . . . . . . . .
 $$ | . . . . . . . . .`;

const board = toBoard(diagram);

console.log(board.title);       // "A joseki variation"
console.log(board.cells[2][2]); // { type: "black", label: "7" }
console.log(board.axis.x);      // { labels: "ABCDEFGHJ", position: "north" }
console.log(board.axis.y);      // { labels: [19, 18, 17, 16, 15, 14, 13, 12, 11], position:  "west" }
console.log(board.borders);     // { north: true, east: false, south: false, west: true }

API

toBoard(slfString: string): Board

Parses a diagram in Sensei's Library Format, returning a Board object.

import {toBoard} from "./slf-parser";
const board = toBoard("..."); // => Board object

Board object

Property | Description ---------------------|------------- title | The title of the board. Undefined if not applicable. cells[row][col]| A 2D array of cells on the board's grid, starting on the north east corner. cells[][].type | The type of cell: "black" for a black stone, "white" for a white stone, "intersection" for an intersection with no stone, "star" for a star point/hoshi with no stone, or "empty" for an intersection with no grid. cells[][].label | A 1 character string label drawn on the cell. Undefined if not applicable. Cells can't have both a label and a mark. cells[][].link | The URL that the cell links to. Undefined if not applicable. cells[][].mark | The shape to draw on the cell: "circle", "cross", "square", or "triangle". Undefined if not applicable. Cells can't have both a label and a mark. lines[i] | An array of lines on the board's grid. Undefined if there are no lines. lines[].type | Either "line" or "arrow". If "arrow", the line ends in an arrow head shape. lines[].start.row | The line's starting row. lines[].start.col | The line's starting column. lines[].end.row | The line's ending row. lines[].end.col | The line's ending column. borders | An object specifying which edges have borders. borders.north | Whether the north edge has a border. borders.east | Whether the east edge has a border. borders.south | Whether the south edge has a border. borders.west | Whether the west edge has a border. axes | An object describing the axes/coordinate labels. Undefined if the axes are hidden. axes.x.labels | Labels for the x-axis, starting from the west. Each character in the string is a label. axes.x.position | Where to show the x-axis: either "north" or "south". axes.y.labels | An array of labels for the y-axis, starting from the north. Each element is a number. axes.y.position | Where to show the y-axis: either "east" or "west".