{"id":26057,"library":"panini","title":"Panini","description":"A super tiny flat file compiler for Gulp, version 1.7.2. It compiles HTML pages using layouts, partials, Handlebars helpers, and external data (JSON/YAML). It is not a full static site generator but focuses on assembling flat files from common elements. Key differentiators: simple Gulp integration, Handlebars-based templating, front matter support for per-page layouts, and ability to load data from JSON, YAML, or Node modules. Release cadence is irregular; last release in 2019. It is part of the Foundation UI framework ecosystem.","status":"maintenance","version":"1.7.2","language":"javascript","source_language":"en","source_url":"https://github.com/foundation/panini","tags":["javascript"],"install":[{"cmd":"npm install panini","lang":"bash","label":"npm"},{"cmd":"yarn add panini","lang":"bash","label":"yarn"},{"cmd":"pnpm add panini","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Handlebars is the templating engine used by Panini for layouts and partials. Panini v1.3.0 upgraded from Handlebars 3 to 4, which introduced breaking changes around raw block execution context.","package":"handlebars","optional":false},{"reason":"Panini is designed as a Gulp plugin; it expects a Gulp stream as input and returns a transformed stream. Without Gulp, Panini cannot be used as intended.","package":"gulp","optional":false}],"imports":[{"note":"Panini is a CommonJS module and does not provide ESM exports. Using require() is correct; there is no default import in ESM style.","wrong":"const panini = require('panini');","symbol":"panini","correct":"import panini from 'panini';"},{"note":"refresh() is a method on the main panini object, not a named export. Use require('panini') and call panini.refresh().","wrong":"import { refresh } from 'panini';","symbol":"panini.refresh","correct":"const panini = require('panini');\npanini.refresh();"},{"note":"The module exports a constructor function directly, not a named export. Use require() to get the constructor.","wrong":"const { Panini } = require('panini');","symbol":"Panini (constructor)","correct":"const Panini = require('panini');\nconst instance = new Panini(options);"}],"quickstart":{"code":"const gulp = require('gulp');\nconst panini = require('panini');\n\ngulp.task('build', function() {\n  return gulp.src('src/pages/**/*.html')\n    .pipe(panini({\n      root: 'src/pages/',\n      layouts: 'src/layouts/',\n      partials: 'src/partials/',\n      helpers: 'src/helpers/',\n      data: 'src/data/',\n      pageLayouts: {\n        'blog': 'blog'\n      }\n    }))\n    .pipe(gulp.dest('dist'));\n});\n\ngulp.watch(['src/{layouts,partials,helpers,data}/**/*'], function() {\n  panini.refresh();\n});","lang":"javascript","description":"Shows a basic Gulp task using Panini to compile HTML pages with layouts, partials, helpers, data, and a watch that refreshes Panini on changes."},"warnings":[{"fix":"Review any custom raw block usage; ensure they are compatible with Handlebars 4's context.","message":"Upgraded from Handlebars 3 to 4 in v1.3.0. Your existing templates will work fine overall, but note that Handlebars 4 changed the execution context for raw blocks (e.g., `{{{{raw}}}}`), which may affect custom helpers that rely on raw blocks.","severity":"breaking","affected_versions":">=1.3.0"},{"fix":"Upgrade to panini v1.6.2 or later.","message":"Panini's dependency `marked` (for markdown helper) was updated to address CVE-2017-17461 in v1.6.2. If you use the markdown helper, ensure you are on v1.6.2 or later.","severity":"deprecated","affected_versions":"<1.6.2"},{"fix":"Replace calls to panini.load() with panini.refresh().","message":"Panini.load() is not available in recent versions; use panini.refresh() instead to reload layouts, partials, helpers, and data.","severity":"gotcha","affected_versions":">=1.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Create a file named 'default.html' in your layouts folder, or ensure the layouts option points to the correct folder.","cause":"Panini expects a layout file named 'default.html' (or .hbs/.handlebars) in the specified layouts folder. If missing, this error occurs.","error":"Error: Layout not found: default"},{"fix":"Verify that the partials folder exists and is correctly specified in the options. Ensure files inside have .html, .hbs, or .handlebars extension.","cause":"This error can occur if the partials folder path is incorrect or does not exist. Panini tries to load partials and fails silently, but accessing the partial may cause this.","error":"TypeError: Cannot read property 'partials' of undefined"},{"fix":"Validate your YAML files using a YAML linter. Ensure proper indentation and syntax.","cause":"Panini uses js-yaml to parse YAML files. An invalid YAML syntax (e.g., indentation errors) will cause this error.","error":"Error: Failed to load data file: unexpected token"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}