Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@sportshead/webpack-buildinfo
Advanced tools
Webpack buildinfo is a Webpack loader that injects build information into code.
yarn add -D @sportshead/webpack-buildinfo # yarn (recommended)
npm install --save-dev @sportshead/webpack-buildinfo # npm
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()}`
);
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 boolean
s, with a default of false
.
Name | Description | Example |
---|---|---|
gitHash | Full git hash of the current commit, as of build time. This is the hash of your project. | "46030d85f6f1f1eaf62578e410e8cd83ddbcc28c" |
gitHashShort | Same as above, but only the first 7 letters/numbers. | "46030d8" |
time | The number of milliseconds elapsed since January 1, 1970 00:00:00 UTC. | 1605960299010 |
platform | OS Platform | "win32" |
arch | OS Arch | "x64" |
cpus | Array of all the cpus | See documentation |
hostname | Computer hostname | "Computer1234" |
freemem | The amount of free system memory in bytes as an integer. | 18772148224 |
totalmem | The total amount of system memory in bytes as an integer. | 34274238464 |
userInfo | An object containing the uid, gid, shell, homedir, and username of the current user. | See documentation |
networkInterfaces | An array of all the network interfaces. | See documentation |
webpackVersion | Webpack version | "5.6.0" |
nodeVersion | Node.js version | "12.19.0" |
npmVersion | npm version | "6.14.8" |
yarnVersion | Yarn version | "2.3.3" |
FAQs
Unknown package
The npm package @sportshead/webpack-buildinfo receives a total of 0 weekly downloads. As such, @sportshead/webpack-buildinfo popularity was classified as not popular.
We found that @sportshead/webpack-buildinfo 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.