Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
hugo-installer
Advanced tools
Installs Hugo into your repository.
Hugo is one of the most popular static site generators. Now, when it comes to web development, we usually select npm as our dependency management solution. Hugo, however, is a tool written in Go. Therefore, Hugo is not integrated into the npm module ecosystem - but instead delivered as a binary.
The Hugo Installer is here to help! It's a small node script which can be used to fetch a specific Hugo binary, for instance using the
postinstall
hook within a package.json
file.
You can get the hugo-installer via npm by adding it as a new devDependency to your package.json
file and running
npm install
. Alternatively, run the following command:
npm install hugo-installer --save-dev
We recommended to use the hugo-installer within the postinstall
hook of a project's package.json
file.
The Hugo version can be set using the --version
CLI parameter. For example:
{
"scripts": {
"postinstall": "hugo-installer --version 0.46"
}
}
You can also use the extended version of Hugo:
{
"scripts": {
"postinstall": "hugo-installer --version 0.46 --extended"
}
}
Bonus tip: The --version
CLI parameter can also be an object path to some value defined in the package.json
file. This allows for the
hugo version to be configured someplace else, e.g. in a otherDependencies
object:
{
"otherDependencies": {
"hugo": "0.46"
},
"scripts": {
"postinstall": "hugo-installer --version otherDependencies.hugo"
}
}
The --destination
CLI parameter can be used to define the folder into which the Hugo binary will be placed. This parameter is optional,
the default destination path is bin/hugo
. For example:
{
"scripts": {
"postinstall": "hugo-installer --version 0.46 --destination bin/hugo"
}
}
Don't forget to add the destination path to your
.gitignore
file!
Once fetched, the hugo binary can be used directly from your favourite command line. For example:
bin/hugo/hugo.exe --config=hugo.config.json
Alternatively, one might also want to integrate Hugo in a NodeJS build script, or a NodeJS-based build tool such as
Gulp. You can execute the Hugo binary using the spawn
command. For example:
const path = require('path');
const spawn = require('child_process').spawn;
// Use Hugo
spawn(path.resolve(process.cwd(), 'bin', 'hugo', 'hugo'), [`--config=hugo.config.json`], {
stdio: 'inherit',
}).on('close', () => {
// Callback
});
FAQs
Installs hugo into your repository.
The npm package hugo-installer receives a total of 2,883 weekly downloads. As such, hugo-installer popularity was classified as popular.
We found that hugo-installer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.