🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more
Socket
Book a DemoInstallSign in
Socket

emojijoiner

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emojijoiner

Create your own Emoji ZWJ sequences with JS!

Source
npmnpm
Version
1.0.8-beta.7
Version published
Weekly downloads
103
221.88%
Maintainers
1
Weekly downloads
 
Created
Source

npm version License npm downloads Downloads per month github tag github release commits since 1.0 open issues Closed issues Open pull requests Closed pull requests Contributors awesome

Create your own ZWJ Emoji Combinations.🎃‍🎀

Downloading Or Including

You can npm install EmojiJoiner like this:

npm install emojijoiner

you can bower install it:

bower install emojijoiner

you can download it from github or you can include it in your webpage with this URI:

https://kepempem.com/EmojiJoiner/EmojiJoiner.js

Usage

  • include EmojiJoiner.js in your web-page.
  • Create an EmojiJoiner object: var PumpkinRibbon = EmojiJoiner("🎃", "🎀");

You had just created an EmojiJoiner Object. This object contains A zwj property, A regexp property and A string property and it lookes like that:

{
zwj: "‍",
regexp: /🎃‍🎀/gi,
string: "🎃‍🎀"
}

The zwj property contains a Zero-Width-Joiner. The regexp property contains a regular expression to match your ZWJ sequence. The string property contains your ZWJ sequence.

This is a simple EmojiJoiner object.

Replacement

The third parameter in the EmojiJoiner constructor is used to make a function to replace the sequence with it. For example, if you'll create this object:

var PumpkinRibbon = EmojiJoiner("🎃", "🎀", "🥓");

It will produce the same object as the one before only this time it will contain a replace property which is a function. The function will locate your ZWJ sequence and replace it with the third parameter.

var PumpkinRibbon = EmojiJoiner("🎃", "🎀", "🥓");
PumpkinRibbon.replace("foobar"); // => foobar
PumpkinRibbon.replace("foobar 🎃🎀"; // => foobar 🥓

If the third parameter will start with HTTPS:// or HTTP:// then the replace function will produce an HTML Image. To disable that or change the width and height, read about the options parameter.

Shortname

The fourth parameter is used by the replace function too. It is used to replace :shortname: in the string that the replace function gets. For Example:

var PumpkinRibbon = EmojiJoiner("🎃", "🎀", "🥓", "PumpkinRibbon");
PumpkinRibbon.replace("foobar"); // => foobar
PumpkinRibbon.replace("foobar 🎃🎀"); // => foobar 🥓
PumpkinRibbon.replace("foobar 🎃🎀 :PumpkinRibbon:"); // => foobar 🥓 🥓
PumpkinRibbon.replace("foobar 🎃🎀 :PUMpKinRIBBon:"); // => foobar 🥓 🥓

options

The fifth parameter is used to configure the EmojiJoiner Object. If you'd like to disable URL to Image in the replace function, set the value of the image property to false. To set the width and height of the image, if the replacement is an image, set the value of the width and height properties to your desired width and height.

EmojiJoiner currently supports only two char sequences and it might support more in the future.

EmojiJoiner is licensed under the MIT license.

Keywords

Emojis

FAQs

Package last updated on 28 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts