Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
npm binary wrapper for Hugo that installs extended or withdeploy Hugo builds and exposes CLI/API for Node.js.
hugo-bin is an npm package that wraps the Hugo static site generator, letting developers install, configure, and run Hugo binaries directly through Node.js workflows.
hugo-bin is a binary wrapper for Hugo, the open-source static site generator maintained by the Hugo team. It takes no site content as input; instead, it downloads the correct Hugo binary for your platform during npm install, then exposes that binary path through a JavaScript API and a command-line interface. The package is written for Node.js, distributed on npm, and maintained by Shun Sato under an MIT license. It lives in the fenneclab/hugo-bin repository.
buildTags to extended to download the Extended Hugo binary, first introduced in Hugo v0.43, which adds Sass/SCSS compilation and other features.buildTags to extended,withdeploy to pull the Hugo version that bundles deploy functionality, available since Hugo v0.137.0.downloadRepo to proxy or mirror the GitHub releases, useful for corporate networks with restricted access.hugo-bin section of package.json, through .npmrc keys, or environment variables prefixed HUGO_BIN_.child_process.execFile, as shown in the README.hugo help via npm exec, or define scripts like "build": "hugo", "create": "hugo new", and "serve": "hugo server" in package.json.devDependency to pin a Hugo version in a JavaScript project and invoke Hugo from npm scripts.downloadRepo to an internal Artifactory or proxy so npm install can fetch the binary despite network restrictions.extended build tag to gain Hugo's built-in Sass/SCSS support without managing a separate binary.hugo through an npm script to compile Markdown content and themes into HTML output.hugo new post/my-new-post.md via the create script to scaffold content with front matter.hugo server to preview the site with live reload.withdeploy version and use Hugo's built-in deployment commands.hugo-bin downloads the Hugo binary during the npm install step, selecting the version and build tags you configured. The downloaded binary is stored inside the package directory, and the package exports its path so Node scripts can execute it. If you change any installation option, you must reinstall hugo-bin itself, as noted in the README, so the correct binary is fetched.
Yes. Set the buildTags option to extended. If the extended binary is not available for your platform, hugo-bin automatically falls back to the normal version.
Yes. Set the downloadRepo option to your proxy URL, either in package.json, .npmrc, or via the HUGO_BIN_DOWNLOAD_REPO environment variable, and hugo-bin will fetch the binary from that repository.
You need to run npm install hugo-bin again to reinstall the package, because the binary is downloaded at install time.
hugo-bin is open source under the MIT license and is available on npm without charge.