1.0.1 • Published 3 years ago

@slwulf/emojitools v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

emojitools

the cool slack emoji manipulation interface for cool kids

Usage

First, install the package into your project.

npm install @slwulf/emojitools

Then, import the package and execute a command.

const Emojitools = require('@slwulf/emojitools')
const cli = 'effects +Intensify http://path.to/my/image'

Emojitools.fromCommandLineInput(cli)
    .then(emoji => emoji.message ? console.log(emoji.message) : emoji.writeToFile())
    .then(filepath => filepath && console.log(filepath))

Emojitools is intended to be used as a command line or chat bot interface, so the static method EmojiTools.fromCommandLineInput, which receives raw user input, is the best way to use it.

The package exposes an emoji interface as its execution result that allows you to access or further modify a command's output. Read below for more details on working with the image output.

The command line interface has built-in help text for each command. Entering emojitools --help will expose a list of commands, and emojitools <command> --help describes each command and its inputs.

API Documentation

Emojitools

  • Emojitools.fromCommandLineInput(cli[, opts])
    • cli (string) the command line input
    • opts (object) render and behavior options
      • plaintext (boolean) determines whether emoji.message is in plaintext or markdown. defaults to false, for markdown.
    • Returns a Promise that resolves to an Emoji instance.

Emoji

  • emoji.message (?string)
    • a property that will be set if an emoji was not rendered, usually because help text was requested instead.
  • emoji.saveToFile([filepath])
    • filepath (string) optional, absolute path the file should be saved at
    • Returns a Promise that resolves to the saved filepath of the rendered emoji
  • emoji.saveToReadStream()
    • Returns a Promise that resolves to a stream.Readable instance of the rendered emoji
1.0.1

3 years ago

1.0.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago