doublechar
v1.0.3
Published
A simple Node.js utility that reads a file, doubles every character, and writes the transformed result into a new file.
Readme
doublechar
A simple Node.js utility that reads a file, doubles every character, and writes the transformed result into a new file.
Installation
npm install doublecharUsage
const doubleChar = require("doublechar");
// Input file: input.txt
// Content: "Hello"
doubleChar("input.txt", "output.txt");
// Output file: output.txt
// Content: "HHeelllloo"API
doubleChar(inputFile, outputFile)
inputFile (string) – Path to the file to read.
outputFile (string) – Path to the file to write transformed output.
The function uses Node.js streams under the hood, making it memory-efficient even for large files.
Example
const doubleChar = require("doublechar");
doubleChar("./example.txt", "./example-doubled.txt");If example.txt contains:
abcThen example-doubled.txt will contain:
aabbccLicense
ISC ©
