15 lines
No EOL
713 B
JavaScript
15 lines
No EOL
713 B
JavaScript
import fs from 'fs'
|
|
import zlib from 'zlib'
|
|
|
|
var original = fs.readFileSync('./index.mjs', 'utf-8')
|
|
.replace(/export default /, 'out = ')
|
|
.replace(/import [^ ]+ from '[^']+'\w*\n/g, '')
|
|
.replace(/fsSyncOriginal/, 'fS')
|
|
.replace(/fsPromisesOriginal/, 'fP')
|
|
.replace(/crypto\./g, 'C.')
|
|
.replace(/path\./g, 'P.')
|
|
.replace(/os\./g, 'O.')
|
|
.trim()
|
|
var compressed = zlib.brotliCompressSync(Buffer.from(original))
|
|
|
|
fs.writeFileSync('meme.mjs', `import fS from 'fs';import fP from 'fs/promises';import C from 'crypto';import P from 'path';import O from 'os';import z from 'zlib';let out;eval(z.brotliDecompressSync(Buffer.from('${compressed.toString('base64')}','base64')).toString());export default out;`) |