https://github.com/twbs/bootstrap
Raw File
Tip revision: 90e449b1aeefdce3787c1382ecd39c71b6c09a2f authored by Mark Otto on 11 January 2024, 21:55:03 UTC
Merge branch 'main' into main-jd-color-modes-progress-bars
Tip revision: 90e449b
banner.mjs
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

const pkgJson = path.join(__dirname, '../package.json')
const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))

const year = new Date().getFullYear()

function getBanner(pluginFilename) {
  return `/*!
  * Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
  * Copyright 2011-${year} ${pkg.author}
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */`
}

export default getBanner
back to top