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 🙏

© 2024 – Pkg Stats / Ryan Hefner

variant.js

v1.0.3

Published

Convert a string into different kind of Unicode variants

Downloads

5

Readme

variant.js

Install

npm i variant.js

Info

Convert a string into different kind of Unicode variants. Created to show some "cool" styled text in the browsers built-in alert(), prompt() and confirm() dialogs.

|Variant | Alias | Description | Example | |:--------- |:-----:|:----------------------------- |:----------------- | | monospace | m | Monospace | 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎 | | bold | b | Bold text |𝐛𝐨𝐥𝐝 | | italic | if | Italic text | 𝑖𝑡𝑎𝑙𝑖𝑐 | | bold italic | bi | bold+italic text | 𝒃𝒐𝒍𝒅 𝒊𝒕𝒂𝒍𝒊𝒄 | | script | c | Handwriting style | 𝓈𝒸𝓇𝒾𝓅𝓉 | | bold script | bc | Bolder handwriting | 𝓫𝓸𝓵𝓭 𝓼𝓬𝓻𝓲𝓹𝓽 | | gothic | g |Gothic (fraktur) | 𝔤𝔬𝔱𝔥𝔦𝔠 | | gothic bold | gb | Gothic in bold| 𝖌𝖔𝖙𝖍𝖎𝖈 𝖇𝖔𝖑𝖉 | | doublestruck | d | Outlined text | 𝕕𝕠𝕦𝕓𝕝𝕖𝕤𝕥𝕣𝕦𝕔𝕜 | | 𝗌𝖺𝗇𝗌 | s | Sans-serif style | 𝗌𝖺𝗇𝗌 | | bold 𝗌𝖺𝗇𝗌 | bs | Bold sans-serif | 𝗯𝗼𝗹𝗱 𝘀𝗮𝗻𝘀 | | italic 𝗌𝖺𝗇𝗌 | is | Italic sans-serif | 𝘪𝘵𝘢𝘭𝘪𝘤 𝘴𝘢𝘯𝘴 | | bold italic sans | bis | Bold italic sans-serif | 𝙗𝙤𝙡𝙙 𝙞𝙩𝙖𝙡𝙞𝙘 𝙨𝙖𝙣𝙨 | | circled | o | Letters within circles | ⓒⓘⓡⓒⓛⓔⓓ | | paranthesis | p | Letters within paranthesis | ⒫⒜⒭⒠⒩⒯⒣⒠⒮⒤ | | fullwidth | w | Wider monospace font | fullwidth |

The text can be enriched with underline or strike (or both) through the flags param:

|Variant | Flags | Example | |:--------- |:-----|:---------------------------- | | gothic | underline | 𝔤̲𝔬̲𝔱̲𝔥̲𝔦̲𝔠̲| | paranthesis | strike | 𝚙̶𝚊̶𝚛̶𝚊̶𝚗̶𝚝̶𝚑̶𝚎̶𝚜̶𝚒̶𝚜̶ |

Example

const variant = require("variant.js");

console.log(variant.format("Hello World", "monospace", "strike")); // "𝙷̶𝚎̶𝚕̶𝚕̶𝚘̶ ̶𝚆̶𝚘̶𝚛̶𝚕̶𝚍̶"

Notes

  • There is no support for special chars such as &, % and so on.
  • Not all combinations of variants and flags is guaranteed to work.
  • Some variants does not support numbers some variants does not support capital or small letters.