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

node-utf-format

v0.3.3

Published

Ⓕⓞⓡⓜⓐⓣ ᴛᴇxᴛ with utf-8 power

Downloads

19

Readme

node-utf-format

Ⓕⓞⓡⓜⓐⓣ ᴛᴇxᴛ with utf-8 power

Build Status NPM version

If all you have to display your text is utf-8 range – use this package to display it almost as github markdown does

Install

npm install node-utf-format

Usage

This is compatible formatter, which uses utf-8 symbols till ffff:

const md = require('node-utf-format');

str = '[]Hello[], *my little friend 111*!\n' +
      'You ()can() have `monospace text and numbers 1 2 3 4`\n' +
      'and you can have _capped text_';
console.log(md.format(str));
// 🄷🄴🄻🄻🄾, ᴍy ʟɪᴛᴛʟᴇ Fʀɪᴇɴᴅ 111!
// You ⓒⓐⓝ have monospace  text  and  numbers  1  2  3  4
// and you can have ᴄᴀᴩᴩᴇᴅ ᴛᴇxᴛ

console.log(md.format('String to be squared', { to: 'sq' }));
// 🅂🅃🅁🄸🄽🄶 🅃🄾 🄱🄴 🅂🅀🅄🄰🅁🄴🄳

console.log(md.format('String to be circled', { to: 'ci' }));
// Ⓢⓣⓡⓘⓝⓖ ⓣⓞ ⓑⓔ ⓒⓘⓡⓒⓛⓔⓓ

console.log(md.format('String to be small capped', { to: 'sc' }));
// sᴛʀɪɴɢ ᴛᴏ ʙᴇ sᴍᴀʟʟ ᴄᴀᴩᴩᴇᴅ

console.log(md.format('String to be regionalized', { to: 'rg' }));
// 🇸​🇹​🇷​🇮​🇳​🇬​ 🇹​🇴​ 🇧​🇪​ 🇷​🇪​🇬​🇮​🇴​🇳​🇦​🇱​🇮​🇿​🇪​🇩

console.log(md.format('String to be full width', { to: 'fw' }));
// String  to  be  full  width

It seems that github code block doesn't show Small caps properly, here it is without code formatting:

sᴛʀɪɴɢ ᴛᴏ ʙᴇ sᴍᴀʟʟ ᴄᴀᴩᴩᴇᴅ

Those are from U+1D400, so as I see - they supported by mac and some of them - by linux by default.

const md = require('./index'); //node-utf-format');

str = 'Hello, *my little friend 111*! You can have `monospace text and numbers 1 2 3 4`\n' +
      'and you can have _italic text_';
console.log(md.format(str));
// Hello, 𝐦𝐲 𝐥𝐢𝐭𝐭𝐥𝐞 𝐟𝐫𝐢𝐞𝐧𝐝 𝟏𝟏𝟏! You can have 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎 𝚝𝚎𝚡𝚝 𝚊𝚗𝚍 𝚗𝚞𝚖𝚋𝚎𝚛𝚜 𝟷 𝟸 𝟹 𝟺
// and you can have 𝑖𝑡𝑎𝑙𝑖𝑐 𝑡𝑒𝑥𝑡

console.log(md.format(str, { font: 'ss' }));
// 𝖧𝖾𝗅𝗅𝗈, 𝗺𝘆 𝗹𝗶𝘁𝘁𝗹𝗲 𝗳𝗿𝗶𝗲𝗻𝗱 𝟭𝟭𝟭! 𝖸𝗈𝗎 𝖼𝖺𝗇 𝗁𝖺𝗏𝖾 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎 𝚝𝚎𝚡𝚝 𝚊𝚗𝚍 𝚗𝚞𝚖𝚋𝚎𝚛𝚜 𝟷 𝟸 𝟹 𝟺
// 𝖺𝗇𝖽 𝗒𝗈𝗎 𝖼𝖺𝗇 𝗁𝖺𝗏𝖾 𝘪𝘵𝘢𝘭𝘪𝘤 𝘵𝘦𝘹𝘵

console.log(md.format('String to be bold', { to: 'b' }));
// 𝐒𝐭𝐫𝐢𝐧𝐠 𝐭𝐨 𝐛𝐞 𝐛𝐨𝐥𝐝

console.log(md.format('String to be italic', { to: 'i' }));
// 𝑆𝑡𝑟𝑖𝑛𝑔 𝑡𝑜 𝑏𝑒 𝑖𝑡𝑎𝑙𝑖𝑐

console.log(md.format('String to be monospace', { to: 'm' }));
// 𝚂𝚝𝚛𝚒𝚗𝚐 𝚝𝚘 𝚋𝚎 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎

console.log(md.format('String to be bold italic', { to: 'bi' }));
// 𝑺𝒕𝒓𝒊𝒏𝒈 𝒕𝒐 𝒃𝒆 𝒃𝒐𝒍𝒅 𝒊𝒕𝒂𝒍𝒊𝒄

console.log(md.format('String to be sans serif', { to: 'ss' }));
// 𝖲𝗍𝗋𝗂𝗇𝗀 𝗍𝗈 𝖻𝖾 𝗌𝖺𝗇𝗌 𝗌𝖾𝗋𝗂𝖿

console.log(md.format('String to be sans serif bold', { to: 'ssb' }));
// 𝗦𝘁𝗿𝗶𝗻𝗴 𝘁𝗼 𝗯𝗲 𝘀𝗮𝗻𝘀 𝘀𝗲𝗿𝗶𝗳 𝗯𝗼𝗹𝗱

console.log(md.format('String to be sans serif italic', { to: 'ssi' }));
// 𝘚𝘵𝘳𝘪𝘯𝘨 𝘵𝘰 𝘣𝘦 𝘴𝘢𝘯𝘴 𝘴𝘦𝘳𝘪𝘧 𝘪𝘵𝘢𝘭𝘪𝘤

console.log(md.format('String to be sans serif bold italic', { to: 'ssbi' }));
// 𝙎𝙩𝙧𝙞𝙣𝙜 𝙩𝙤 𝙗𝙚 𝙨𝙖𝙣𝙨 𝙨𝙚𝙧𝙞𝙛 𝙗𝙤𝙡𝙙 𝙞𝙩𝙖𝙡𝙞𝙘

console.log(md.format('And bold script string', { to: 'bs' }));
// 𝓐𝓷𝓭 𝓫𝓸𝓵𝓭 𝓼𝓬𝓻𝓲𝓹𝓽 𝓼𝓽𝓻𝓲𝓷𝓰

License

The MIT License