summaryrefslogtreecommitdiff
path: root/src/misc/license.ts
blob: 8b12923ca165a7903c3eadd0c959c3e35f5e9b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import * as fs from 'fs';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

//const _filename = fileURLToPath(import.meta.url);
const _filename = __filename;
const _dirname = dirname(_filename);

const license = fs.readFileSync(_dirname + '/../../LICENSE', 'utf-8');

const licenseHtml = license
	.replace(/\r\n/g, '\n')
	.replace(/(.)\n(.)/g, '$1 $2')
	.replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');

export {
	license,
	licenseHtml
};