LilyWare

May 11, 2026 ยท View on GitHub

LilyWare is an express middleware for serving lilypond files. Written in TypeScript; ships with type declarations.

Usage

app.use(lilyware(basePath))

Looks in basePath for requested .ly files and serves them rendered according to the URL query string (e.g. test.ly?format=png&resolution=30).

Requests that do not end in .ly are passed through with next().

Options

app.use(lilyware(basePath, {
  cache: true,      // default: in-memory cache keyed by file mtime
  renderer: ...,    // optional override for the lilynode.renderFile callable
                    // (mainly useful for testing)
}))

Query options

Possible options to configure rendering via URL query parameters.

format

Possible values: png, svg, pdf, ps, midi Default: png

Unsupported values return 400 Bad Request.

resolution

Resolution in ppcm (only meaningful for the png format). Default: 50

Responses

StatusWhen
200Rendered output, with the matching Content-Type
400format query param is not supported
403Path attempts to escape basePath
404.ly file does not exist
500Renderer error (forwarded via next(error))