Skip to content

Instantly share code, notes, and snippets.

View pavlobu's full-sized avatar

Paul Pavlo Buidenkov pavlobu

View GitHub Profile
@pavlobu
pavlobu / index.js
Created January 19, 2024 15:00
Decode Cyrillic metadata in mp3 files fixing gibberish files description saved in windows 1251 encoding | using NodeJS
import mm from 'music-metadata';
import { promises as fs } from 'fs';
import path from 'path';
import iconv from 'iconv-lite';
import NodeID3 from 'node-id3';
// Function to convert from Windows-1251 to UTF-8
function convertFromWin1251(buffer) {
return iconv.decode(buffer, 'win1251');
}
@pavlobu
pavlobu / nodejs-replace-matching-strings-in-text-files-of-a-zip.js
Last active October 6, 2022 22:01
Node.js | A Script that replaces matching strings in text files of a .zip file
/**
A Script that replaces matching strings in text files of a .zip file
Dependencies:
npm i extract-zip
npm i zip-local
Usage:
The script can be run as 'node run nodejs-replace-matching-strings-in-text-files-of-a-zip.js'
Configuration:
The variables of this script can be replaced: