index.mjs 665 B

123456789101112131415161718192021
  1. import fs from 'node:fs/promises'
  2. import path from 'node:path'
  3. import { fileURLToPath } from 'node:url'
  4. const __dirname = path.dirname(fileURLToPath(import.meta.url))
  5. const pkgJson = path.join(__dirname, 'package.json')
  6. const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))
  7. const year = new Date().getFullYear()
  8. function getBanner(pluginFilename) {
  9. return `/*!
  10. * Tabler${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
  11. * Copyright 2018-${year} The Tabler Authors
  12. * Copyright 2018-${year} codecalm.net Paweł Kuna
  13. * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
  14. */`
  15. }
  16. export default getBanner