Skip to content

nzws/libemoji.js

Repository files navigation

@nzws/libemoji.js

GitHub Workflow Status npm (scoped) License

Unofficial nodejs wrapper for emoji-gen/libemoji

Original Library

libemoji.js is an unofficial library, do not send any questions/issues about this to the original author.

Usage

yarn add @nzws/libemoji.js # or `npm i @nzws/libemoji.js`
import { generate } from '@nzws/libemoji.js';
import { promises } from 'fs';

void (async () => {
  const emoji = generate('えも\nじ', {
    width: 128,
    height: 128,
    color: '#1fddffff',
    backgroundColor: '#00000000',
    textAlign: 'center',
    textSizeFixed: false,
    disableStretch: false,
    typefaceFile: '/path/to/JapaneseFontFile.otf',
    typefaceName: '',
    format: 'png',
    quality: 100
  });

  await promises.writeFile('./example/emoji.png', emoji.buffer);
})();

Development

Requirements

  • Node.js v16
  • yarn v1
  • CMake
  • Python 2.7 (recommend to use asdf)
  • C11 Compiler
  • C++14 Compiler

Initialize

# Initialize
asdf install python 2.7.18
sudo apt install clang-format # for linux

SKIP_BUILD=true yarn
yarn setup

About

Unofficial nodejs wrapper for emoji-gen/libemoji

Resources

License

Stars

Watchers

Forks

Packages

No packages published