Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hugo-bin

Package Overview
Dependencies
Maintainers
2
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hugo-bin

Binary wrapper for Hugo

  • 0.131.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76K
increased by8.83%
Maintainers
2
Weekly downloads
 
Created
Source

hugo-bin npm version Build Status

Binary wrapper for Hugo

  • hugo-bin supports the Extended Hugo version
  • For usage within corporate networks or behind corporate proxies, the download repository can be overwritten

See Installation options for more details.

Install

npm install hugo-bin --save-dev

Usage

API

import { execFile } from 'node:child_process';
import hugoPath from 'hugo-bin';

execFile(hugoPath, ['version'], (error, stdout) => {
  if (error) {
    throw error;
  }

  console.log(stdout);
});

CLI

Unix
npm exec hugo help
npm run create -- post/my-new-post.md # see below 'npm run-script'
Windows
npm exec hugo help
rem see below 'npm run-script'
npm run create -- post/my-new-post.md

npm run-script

{
  "scripts": {
    "build": "hugo",
    "create": "hugo new",
    "serve": "hugo server"
  }
}

See the Hugo Documentation for more information.

Installation options

hugo-bin supports options to change the variation of Hugo binaries, to overwrite the download repository and the Hugo version.

Each option can be configured in one of the following ways:

The hugo-bin section of your package.json

{
  "name": "your-package",
  "version": "0.0.1",
  "hugo-bin": {
    "buildTags": "extended",
    "downloadRepo": "https://some.example.com/artifactory/github-releases",
    "version": "0.124.1"
  }
}

As local or global .npmrc configuration file

hugo_bin_build_tags = "extended"
hugo_bin_download_repo = "https://some.example.com/artifactory/github-releases"
hugo_bin_hugo_version = "0.124.1"

As environment variables

On Linux/macOS:

export HUGO_BIN_BUILD_TAGS="extended"
export HUGO_BIN_DOWNLOAD_REPO="https://some.example.com/artifactory/github-releases"
export HUGO_BIN_HUGO_VERSION="0.124.1"

On Windows:

set HUGO_BIN_BUILD_TAGS=extended
set HUGO_BIN_DOWNLOAD_REPO=https://some.example.com/artifactory/github-releases
set HUGO_BIN_HUGO_VERSION=0.124.1

Note that you have to run npm install hugo-bin to re-install hugo-bin itself, if you change any of these options.

Options

buildTags
  • Type: string
  • Default: ""

Set buildTags to extended to download the extended version binary.

If this is set to extended but it's not available for the user's platform, then the normal version will be downloaded instead.

downloadRepo
  • Type: string
  • Default: "https://github.com"

Set it to your proxy URL to download the hugo binary from a different download repository.

hugoVersion

You can override the Hugo version here. Please note that if any of the URLs have changed upstream, you might not be able to use any version and you will probably need to update to a newer hugo-bin version which takes into consideration the new URLs.

Supported Hugo versions

See the package.json commit history.

Super Inspired By

License

MIT © Shun Sato

Keywords

FAQs

Package last updated on 10 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc