No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

banner.js 571B

1234567891011121314151617
  1. const fs = require('fs');
  2. const pkg = require('./package.json');
  3. const filename = 'anchor.min.js';
  4. const script = fs.readFileSync(filename);
  5. const padStart = str => ('0' + str).slice(-2)
  6. const dateObj = new Date;
  7. const date = `${dateObj.getFullYear()}-${padStart(dateObj.getMonth() + 1)}-${padStart(dateObj.getDate())}`;
  8. const banner = `/**
  9. * AnchorJS - v${pkg.version} - ${date}
  10. * ${pkg.homepage}
  11. * Copyright (c) ${dateObj.getFullYear()} Bryan Braun; Licensed ${pkg.license}
  12. */
  13. `;
  14. if (script.slice(0, 3) != '/**') {
  15. fs.writeFileSync(filename, banner + script);
  16. }