text-compression
Advanced tools
+1
-1
| { | ||
| "name": "text-compression", | ||
| "version": "2.0.2", | ||
| "version": "3.1.0", | ||
| "description": "A simple text compression and decompression package", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
-19
| const { compress } = require('text-compression'); | ||
| const fs = require('fs'); | ||
| async function compressFile(filePath) { | ||
| try { | ||
| const text = fs.readFileSync(filePath, 'utf-8'); | ||
| const compressedText = await compress(text); | ||
| const outputFilePath = `${filePath}.gz`; | ||
| fs.writeFileSync(outputFilePath, compressedText); | ||
| console.log(`Dosya başarıyla sıkıştırıldı: ${outputFilePath}`); | ||
| } catch (err) { | ||
| console.error('Hata oluştu:', err); | ||
| } | ||
| } | ||
| const inputFilePath = 'test.txt'; | ||
| compressFile(inputFilePath); |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
-50%407685
-0.14%6
-14.29%45
-25%