1. convert-gitmoji
♻️ Convert strings to gitmojis
convert-gitmoji
Package: convert-gitmoji
Created by: Intevel
Last modified: Thu, 25 Jan 2024 21:15:07 GMT
Version: 0.1.5
License: MIT
Downloads: 66,287
Repository: https://github.com/Intevel/convert-gitmoji

Install

npm install convert-gitmoji
yarn add convert-gitmoji

convert-gitmoji

npm version
npm downloads
Github Actions CI
License

Simple way to replace strings with gitmojis ♻️

Install

 
# Using npm
npm install convert-gitmoji

# Using yarn
yarn add convert-gitmoji

Usage

convert(content: string, withSpace?: boolean | "leading" | "trailing" | "both")

Convert all gitmojis in a string
withSpace is default false, if true its sets a trailing (at the end of the string) whitespace after the converted gitmoji.

For more control, withSpace can also be set to leading for a whitespace before the string, trailing for a whitespace at the end of the string (same as true) or both to have the string surrounded by whitespaces.

 // CommonJS
const { convert } = require("convert-gitmoji");

// ESM
import { convert } from "convert-gitmoji";

convert(':arrow_up: bump qs from 6.10.3 to 6.10.4 (xxx) - **helper:** :pencil:  Updated TSDoc (xxx)', true);

--> "⬆️ bump qs from 6.10.3 to 6.10.4 (xxx) - **helper:** ✏️ Updated TSDoc (xxx)"

convert("This:art:is on:fire:!")

--> "This🎨is on🔥!"

convert("This:art:is on:fire:!", "both")

--> "This 🎨 is on 🔥 !"

License

Published under MIT - Made with ❤️ by Conner Luka Bachmann

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code