npm.io
2.0.0 • Published 8 months ago

chimpers

Licence
MIT
Version
2.0.0
Deps
2
Size
58 kB
Vulns
1
Weekly
0

chimpers

A nodejs library that Hide files / zip / images in text by hidden format.

Web Demo | chimpers npm | chimpers-web npm | Github

Install

npm i chimpers
yarn add chimpers

2.0 Updates

  1. The encrypt string is not require space ("").

Notices

  1. Hidden file is not encrypted currently.
  2. Do not attempt to hide large size file.
  3. Single file that smaller than 4kb is recommended.

Usage

import { addFileInText, decodeFile } from "chimpers"
import path from "path";

( async () => {

    const filePath = path.join(__dirname, "yo.zip")

    // Add files to text
    const text = addFileInText(
        "hello mate I am peter.", // Text to add files
        filePath,                 // Your txt / zip / file ... locations
        { copyToBoard: false }     // Optional: Will regarding text copy to your clipboard
    );
    
    // Decode regarding text
    await decodeFile(
        text,          // Encoded text string
        "hello",       // Output file name
        __dirname      // Output file path
    );

})()

Utilis

// Hide files in text
function addFileInText(
    text: string,                 
    file_path: string,
    option?: AddFileInTextOptions
): string 

interface AddFileInTextOptions{
    copyToBoard?: boolean
}
// Decode hidden text and output a file
async function decodeFile(
    encodedText: string, 
    outputFileName: string = "decodedFile", 
    outputPath: string = process.cwd()
): Promise<Uint8Array> 

Roadmap

  • Encrypt passowrd options
  • Better compress size
  • Web npm packages

Keywords