unplugin-info weekly downloads statistics
By yjl9903 · npm · Vite plugins
Export build information as virutal module
unplugin-info has 16,258 recorded weekly downloads on npm, an increase of 8.9% over the past 30 days, ranking #1109 of 3,247 tracked listings.
About unplugin-info
unplugin-info
Export build information as virutal module.
This plugin helps you add build timestamp / commit SHA / CI environment / package.json / ... to your application. So you can easily check whether the production version meets your expectations, or config your application.
Migration from v0 to v1
- Move git related information from
~build/infoto~build/git- Move CI related information from
~build/infoto~build/ci- Remove
commitsSinceLastTagfrom~build/git
Installation
npm i -D unplugin-info
<details>
<summary>Vite</summary><br>
// vite.config.ts
import Info from 'unplugin-info/vite';
export default defineConfig({
plugins: [
Info()
]
});
Full example is located at examples/vite.
<br></details>
<details> <summary>Rollup</summary><br>// rollup.config.js
import Info from 'unplugin-info/rollup';
export default {
plugins: [
Info()
]
};
<br></details>
<details> <summary>Rspack</summary><br>// rspack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-info/rspack')()
]
};
Full example is located at examples/rspack.
<br></details>
<details> <summary>Webpack</summary><br>// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-info/webpack')()
]
};
Full example is located at examples/webpack.
<br></details>
<details> <summary>Nuxt</summary><br>// nuxt.config.ts
export default defineNuxtConfig({
modules: ['unplugin-info/nuxt'],
info: {
// Your unplugin-info options ...
}
});
Full example is located at examples/nuxt.
<br></details>
<details> <summary>Vue CLI</summary><br>// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-info/webpack')()
]
}
};
<br></details>
<details> <summary>Quasar</summary><br>// quasar.conf.js [Vite]
module.exports = {
vitePlugins: [
[
'unplugin-info/vite',
{
/* options */
}
]
]
};
// quasar.conf.js [Webpack]
const Info = require('unplugin-info/webpack');
module.exports = {
build: {
chainWebpack(chain) {
chain.plugin('unplugin-info').use(
Info()
);
}
}
};
<br></details>
<details> <summary>esbuild</summary><br>// esbuild.config.js
import { build } from 'esbuild';
build({
/* ... */
plugins: [
require('unplugin-info/esbuild')({
/* options */
}),
],
});
<br></details>
<details> <summary>Astro</summary><br>// astro.config.mjs
import Info from 'unplugin-info/astro';
export default defineConfig({
integrations: [
Info()
],
});
<br></details>
TypeScript
To make the TypeScript work, you can add unplugin-info/client to your corresponding tsconfig.json.
{
"compilerOptions": {
// ...
"types": [
"unplugin-info/client"
],
},
// ...
}
Or you can add TypeScript triple-slash directives to your .d.ts (i.e. for projects initialized by Vite, it may be src/env.d.ts).
// Your .d.ts file
/// <reference types="unplugin-info/client" />
Or if you did some advanced modification (see below), you can just copy and paste client.d.ts to your project, and then do anything you want.
Usage
unplugin-info creates several virtual modules, ~build/time, ~build/git, ~build/ci, ~build/console, ~build/meta, ~build/env, and ~build/package.
You can just import these modules as usual, and do anything with them. Common use cases may be like:
// main.ts
import now from '~build/time'
import { sha } from '~build/git'
// console log the build info
console.log(`Build ${sha} at ${now}`)
// App.tsx
import now from '~build/time'
// Render it in your app
function App() {
return <span>{now.toLocaleString()}</span>
}
~build/time
It exports the timestamp when the vite started.
import now from '~build/time'
console.log(now)
// There will be a log like "Fri Jun 24 2022 16:30:30 GMT+0800 (中国标准时间)"
~build/git
It exports the infomation about the current git repo, which is powered by simple-git.
import {
github,
sha,
abbreviatedSha,
tag,
lastTag,
committer,
committerEmail,
committerDate,
author,
authorEmail,
authorDate,
commitMessage
} from '~build/git';
// ...
[!NOTE]
From
unplugin-info@0.6.0, the original virtual module called~build/infowill be renamed to~build/git, and the CI/CD related information will be moved to another virtual module called~build/ci.
You can even custom or override the exported git information.…
Description from the npm listing.
- debug
- config
- unplugin
- build
- vite
- vite-plugin
- webpack
- rspack
- git
- CI
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (591)Similar npm Vite plugins plugins
All 20 unplugin-info alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/unplugin-info. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.