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

ts-emoji

v1.0.1

Published

Impeccable TypeScript for the Expressive Developer

Downloads

1

Readme

🚀 ts-emoji 🚀

Impeccable TypeScript for the Expressive Developer

🎉 Revel in the Renaissance of Commenting 🎉

Behold! The monumental ts-emoji, an artisanal TypeScript preprocessor destined to intertwine the charm of emojis with the sturdiness of TypeScript directives.

The craftsmanship embedded within ts-emoji enables developers to adorn their codebase with an ensemble of playful and succinct emojis, which, behind the curtains, transmutes into genuine TypeScript directives during the compilation.

Imagine, dear reader, a world where your TypeScript artifacts not merely serve as the backbone of your logical operations but also cascade through the repository, whispering the subtle nuances of your code’s intentions via the gentle emotive embrace of emojis. A symphony of symbols and logic entwined together in a beautiful tapestry of code!

✨ Overview of Our Enchanting Journey ✨

Consider, for a moment, the mesmerizing dance of emojis and TypeScript, seamlessly intertwining to portray the esoteric intentions hidden beneath the code’s austere surface, unfolding thus:

// 🙉
const x: any = 'The magic is invisible here';

// 🙈
// This enchanting block shall not summon TypeScript’s scrutiny
const y: string = 123;

// 📝 Ah, a future refinement awaits herein!
function add(a: number, b: number): number {
  return a + b;
}

// 👀 Unveil TypeScript’s gaze!
// 🙊 Anticipate an enchanting error below
const z: number = 'A number? Nay, a string!';

📘 Tome of Installation 📘

To commence, integrate this artisanal toolkit into your mystical codebase by invoking the following incantation within your terminal:

npm install ts-emoji --save-dev

🗝️ Unveiling the Enchantments: Usage 🗝️

Preprocessing Your Script

Employ ts-emoji to gently caress your TypeScript, replacing the enchanting emojis with rigorous TypeScript directives:

import { preprocessFile } from 'ts-emoji';

preprocessFile('./path-to-your/enchanting-script.ts');

Enabling the Enchantments: Configuration

Include a preprocessor in your TypeScript or JavaScript workflow to summon ts-emoji prior to the traditional transpilation.

Example Configuration with Webpack

Using the ts-loader and its getCustomTransformers option, whisper ts-emoji into your build process:

const { preprocessTs } = require('ts-emoji');

// webpack.config.js
module.exports = {
  // Your configurations dwell herein...
  module: {
    rules: [
      {
        test: /\.ts$/,
        loader: 'ts-loader',
        options: {
          getCustomTransformers: program => ({
            before: [preprocessTs(program)]
          })
        }
      }
    ]
  }
};

🌍 Universal Emojis to TypeScript Directives 🌍

Behold the default mappings, bridging the whimsical world of emojis and the steadfast reliability of TypeScript directives:

{
  "🙉": "@ts-ignore",
  "🙈": "@ts-nocheck",
  "🙊": "@ts-expect-error",
  "👀": "@ts-check",
  // ...more of the enchanting mappings...
}

You may peruse emojis.json within the library’s confines for the exhaustive list of mappings.

🛠️ Contribution & Enhancement 🛠️

Kindred spirits desiring to weave their own enchantments into ts-emoji are most welcome. Submit your pull requests and embroil yourself in the creation of an ever more enchanting toolkit for all!

Running Tests

To ensure your magicks do not disturb the existing enchantments, invoke the test suite with:

npm test

📜 License 📜

Released under the MIT License.

Embellish your TypeScript with the joys of emojis and embark upon a coding journey where logic and emotion dance together in a symphony of symbiotic harmony!

🚀 Happy Coding, Enchanting Developer! 🚀