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

@sportshead/webpack-buildinfo

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sportshead/webpack-buildinfo

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

webpack-buildinfo

Webpack buildinfo is a Webpack loader that injects build information into code.

Table of Contents

Installation

yarn add -D @sportshead/webpack-buildinfo # yarn (recommended)

npm install --save-dev @sportshead/webpack-buildinfo # npm

Usage

ES6 Modules:

import buildinfo from "!@sportshead/webpack-buildinfo?gitHashShort&time!";

Node.JS require:

const buildinfo = require("!@sportshead/webpack-buildinfo?gitHashShort&time!");

You can then use the buildinfo object like so:

console.log(
    `MyCoolProject v${buildinfo.gitHashShort} compiled at ${new Date(
        buildinfo.time
    ).toISOString()}`
);

Configuration

Change the import string with the flags to set. E.g. "!@sportshead/webpack-buildinfo?flag1&flag2&flag3!"

For more up to date information see the source code.

esModule

Type: boolean
Default: true
Description: Whether or not to use ES6 module syntax for output (i.e. export default instead of module.exports =)

all

Type: boolean
Default: false
Description: Override to enable all of the below flags.

The following flags are all booleans, with a default of false.

NameDescriptionExample
gitHashFull git hash of the current commit, as of build time. This is the hash of your project."46030d85f6f1f1eaf62578e410e8cd83ddbcc28c"
gitHashShortSame as above, but only the first 7 letters/numbers."46030d8"
timeThe number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.1605960299010
platformOS Platform"win32"
archOS Arch"x64"
cpusArray of all the cpusSee documentation
hostnameComputer hostname"Computer1234"
freememThe amount of free system memory in bytes as an integer.18772148224
totalmemThe total amount of system memory in bytes as an integer.34274238464
userInfoAn object containing the uid, gid, shell, homedir, and username of the current user.See documentation
networkInterfacesAn array of all the network interfaces.See documentation
webpackVersionWebpack version"5.6.0"
nodeVersionNode.js version"12.19.0"
npmVersionnpm version"6.14.8"
yarnVersionYarn version"2.3.3"

FAQs

Package last updated on 22 Nov 2020

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