New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

text-compression

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-compression - npm Package Compare versions

Comparing version
2.0.2
to
3.1.0
+1
-1
package.json
{
"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",

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);