mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 12:35:40 -04:00
build: convert code from CJS to ESM
This commit is contained in:
@@ -1,16 +1,33 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const fs = require('fs');
|
/*
|
||||||
const https = require('https');
|
Import Packages
|
||||||
const path = require('path');
|
*/
|
||||||
const UserAgent = require('user-agents');
|
|
||||||
const http = require('http');
|
import os from 'os'
|
||||||
const os = require('os');
|
import fs from 'fs'
|
||||||
const zlib = require('zlib');
|
import https from 'https'
|
||||||
const { randomUUID } = require('crypto');
|
import path from 'path';
|
||||||
const { channel } = require('diagnostics_channel');
|
import UserAgent from 'user-agents';
|
||||||
|
import http from 'http'
|
||||||
|
import zlib from 'zlib'
|
||||||
|
import chalk from 'chalk';
|
||||||
const cache = new Map();
|
const cache = new Map();
|
||||||
|
|
||||||
|
/*
|
||||||
|
Import package.json values
|
||||||
|
*/
|
||||||
|
|
||||||
|
const { name, author, version, repository } = JSON.parse(fs.readFileSync('./package.json'));
|
||||||
|
|
||||||
|
/*
|
||||||
|
Old CJS variables converted to ESM
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
const __filename = fileURLToPath(import.meta.url); // get resolved path to file
|
||||||
|
const __dirname = path.dirname(__filename); // get name of directory
|
||||||
|
|
||||||
let URLS_FILE;
|
let URLS_FILE;
|
||||||
let FORMATTED_FILE;
|
let FORMATTED_FILE;
|
||||||
let EPG_FILE;
|
let EPG_FILE;
|
||||||
|
|||||||
Reference in New Issue
Block a user