npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

hide-data-in-string

v0.0.6

Published

Embed portable data in strings. A steganography library using invisible characters to encode data in plain text

Readme

Hide Data In String⁠ ts ts ts

🕵 ️ About

hide-data-in-string is a lightweight npm package that enables you to embed and extract portable, hidden data within strings using invisible character encoding. These strings are fully portable and can be sent to and extracted by other applications using this library. By leveraging these special Unicode characters, this package ensures that data remains hidden in plain sight, making it ideal for applications that require discreet data storage or messaging within text. This package works with both CommonJS (CJS) and ECMAScript Modules (ESM), and includes full TypeScript support.

This is a simple example of data stenography, the practice of concealing data within non-obtrusive media, such as text or images, without altering its appearance to the human eye. With hide-data-in-string, you can apply this concept to web applications. This method ensures that your data remains hidden in plain sight, offering a stealthy solution for embedding metadata, secure messages, or tracking information in user-facing content.

Staring this repo 𝕚𝕤 𝕥𝕙𝕖 𝕖𝕒𝕤𝕚𝕖𝕤𝕥 𝕨𝕒𝕪 𝕥𝕠 𝕝𝕠𝕠𝕜 𝕝𝕚𝕜𝕖 𝕒 𝕥𝕖𝕒𝕞 𝕡𝕝𝕒𝕪𝕖𝕣 𝕨𝕚𝕥𝕙𝕠𝕦𝕥 𝕒𝕔𝕥𝕦𝕒𝕝𝕝𝕪 𝕔𝕠𝕟𝕥𝕣𝕚𝕓𝕦𝕥𝕚𝕟𝕘 𝕒𝕟𝕪𝕥𝕙𝕚𝕟𝕘 ✨🧠✨

💻 Installation

npm

npm install hide-data-in-string

Or, if you're using Yarn

yarn add hide-data-in-string

🚢 Usage

importing

import { embedData, extractData, hasEmbeddedData } from 'hide-data-in-string';

Embedding hidden data into a string

const text = "Hello, World!";
const hiddenMessage = "The secret is monkey";
const stringWithEmbeddedData = embedData(text, hiddenMessage
console.log(stringWithEmbeddedData);
// "Hello, World!"

Extracting hidden data from a string

const extractedMessage = extractData(stringWithEmbeddedData);
console.log(extractedMessage);
// "The secret is monkey"

Checking for hidden data

console.log(hasEmbeddedData(stringWithEmbeddedData));  // true
const normalString = "Hello, World!"
console.log(hasEmbeddedData(normalString));  // false

👽 Advanced Usage

Embedding and Extracting Complex Data (e.g., Objects) You can also hide more complex data, such as JSON objects, within strings. This is especially useful when you need to transmit or store data in a compact, discreet form without exposing it directly.

Embedding an object into a string

First, you'll need to serialize the object into a JSON string and then embed it into your target string. Here's how you can do that:

const user = {
  name: "John Doe",
  email: "[email protected]",
  role: "admin"
};

const text = "Important message here";
const hiddenData = JSON.stringify(user);  

const stringWithEmbeddedData = embedData(text, hiddenData);
console.log(stringWithEmbeddedData);
// "Important message here"

const extractedData = extractData(stringWithEmbeddedData);
const parsedObject = JSON.parse(extractedData);
console.log(parsedObject);
// { name: "John Doe", email: "[email protected]", role: "admin" }

🚀 Use Cases

  • Messaging with metadata: Embed information within text without altering its visible content.
  • Data Integrity: Track changes or store metadata in strings without risking exposure.
  • Privacy-Focused Applications: Hide tracking or session data in plain sight for non-invasive user identification.
  • Digital Watermarking: Embed invisible markers in content for copyright or attribution purposes.
  • Tracking Interactions: Store interaction data in text to monitor user behavior without cookies.
  • Anti-Fraud Measures: Conceal identifiers or hashes in strings for secure verification processes.

Please use hide-data-in-string resposibly. Let's keep things fair and respect privacy