How to use node-emoji - 10 common examples

To help you get started, weโ€™ve selected a few node-emoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inikulin / publish-please / test / 01-elegant-status-reporter.spec.js View on Github external
'use strict';

/* eslint-disable no-unused-vars */
const should = require('should');
const packageName = require('./utils/publish-please-version-under-test');
const reporter = require('../lib/reporters/elegant-status-reporter');
const rename = require('fs').renameSync;
const pathJoin = require('path').join;
const emoji = require('node-emoji').emoji;
const chalk = require('chalk');
const envType = require('../lib/reporters/env-type');
const lineSeparator = '----------------------------------';

describe('Elegant status reporter', () => {
    let nativeExit;
    let nativeConsoleLog;
    let nativeIsCI;
    let exitCode;
    let output;

    beforeEach(() => {
        console.log(`${lineSeparator} begin test ${lineSeparator}`);
        exitCode = undefined;
        output = '';
        nativeExit = process.exit;
github inikulin / publish-please / test / 01-elegant-status-reporter.spec.js View on Github external
it('Should report a succeeded process', () => {
        // Given
        const message = 'yo process passed';

        // When
        reporter.reportSucceededProcess(message);
        // Then
        if (typeof process.env.APPVEYOR === 'undefined') {
            output.should.containEql(emoji.tada);
        }
    });
github yarnpkg / yarn / src / cli / commands / install.js View on Github external
callThroughHook('linkStep', async () => {
        // remove integrity hash to make this operation atomic
        await this.integrityChecker.removeIntegrityFile();
        this.reporter.step(curr, total, this.reporter.lang('linkingDependencies'), emoji.get('link'));
        flattenedTopLevelPatterns = this.preparePatternsForLinking(
          flattenedTopLevelPatterns,
          manifest,
          this.config.lockfileFolder === this.config.cwd,
        );
        await this.linker.init(flattenedTopLevelPatterns, workspaceLayout, {
          linkDuplicates: this.flags.linkDuplicates,
          ignoreOptional: this.flags.ignoreOptional,
        });
      }),
    );
github fulcrumapp / fulcrum-desktop / resources / yarn / yarn / lib-legacy / cli / commands / why.js View on Github external
// init
    reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck'));
    const lockfile = yield (_wrapper || _load_wrapper()).default.fromDirectory(config.cwd, reporter);
    const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);

    var _ref7 = yield install.fetchRequestFromCwd();

    const depRequests = _ref7.requests,
          patterns = _ref7.patterns;

    yield install.resolver.init(depRequests, install.flags.flat);
    const hoisted = yield install.linker.getFlatHoistedTree(patterns);

    // finding
    reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag'));

    let match;
    for (const _ref8 of hoisted) {
      var _ref9 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref8, 2);

      const loc = _ref9[0];
      const info = _ref9[1];

      if (info.key === query || info.previousKeys.indexOf(query) >= 0) {
        match = [loc, info];
        break;
      }
    }

    if (!match) {
      reporter.error(reporter.lang('whyUnknownMatch'));
github yarnpkg / yarn / src / cli / commands / remove.js View on Github external
throw new MessageError(reporter.lang('moduleNotInManifest'));
    }
  }

  // save manifests
  await config.saveRootManifests(rootManifests);

  // run hooks - npm runs these one after another
  for (const action of ['preuninstall', 'uninstall', 'postuninstall']) {
    for (const [loc] of manifests) {
      await config.executeLifecycleScript(action, loc);
    }
  }

  // reinstall so we can get the updated lockfile
  reporter.step(++step, totalSteps, reporter.lang('uninstallRegenerate'), emoji.get('hammer'));
  const installFlags = {force: true, workspaceRootIsCwd: true, ...flags};
  const reinstall = new Install(installFlags, config, new NoopReporter(), lockfile);
  await reinstall.init();

  //
  reporter.success(reporter.lang('uninstalledPackages'));
}
github peterthehan / holo / src / commands / users.js View on Github external
database.ref(`guilds/${message.guild.id}/messages`).once('value', (snapshot) => {
      const db = snapshot.val();
      if (!db) {
        error(message, '', `My records are empty!`);
        return;
      }

      // determine emoji
      filter = emoji.hasEmoji(filter)
        ? emoji.unemojify(filter)
        : filter.match(/:\d+>/)[0];
      filter = filter.substring(1, filter.length - 1);

      usersInfo(message, db, filter);
    }, (errorObject) => {
      console.log('The read failed: ' + errorObject.code);
github bjork24 / google-calendar-slack-status / index.js View on Github external
app.post('/', (req, res, next) => {
  // check for secret token
  if (!req.body.token || req.body.token !== process.env.SECRET_TOKEN) {
    next();
    return;
  }
  // store token
  const token = process.env.SLACK_TOKEN;
  // log some stuff for dev
  console.log(req.body);
  // grab status and emojis and clean it up
  let status = req.body.title;
  let statusEmoji = nodeEmoji.unemojify('๐Ÿ—“');
  const statusHasEmoji = emojiRegex().exec(status);
  if (statusHasEmoji) {
    statusEmoji = nodeEmoji.unemojify(statusHasEmoji[0]);
    console.log(`CUSTOM EMOJI! ${statusEmoji}`);
    status = nodeEmoji.strip(status);
  }
  // additional tokens
  const dndToken = '[DND]';
  const awayToken = '[AWAY]';
  // parse event start/stop time
  const dateFormat = 'MMM D, YYYY [at] hh:mmA';
  const start = moment(req.body.start, dateFormat);
  const end = moment(req.body.end, dateFormat);
  // check for DND
  if (status.includes(dndToken)) {
    slack.dnd.setSnooze({
      token,
      num_minutes: end.diff(start, 'minutes')
    });
github peterthehan / holo / src / commands / users.js View on Github external
database.ref(`guilds/${message.guild.id}/messages`).once('value', (snapshot) => {
      const db = snapshot.val();
      if (!db) {
        error(message, '', `My records are empty!`);
        return;
      }

      // determine emoji
      filter = emoji.hasEmoji(filter)
        ? emoji.unemojify(filter)
        : filter.match(/:\d+>/)[0];
      filter = filter.substring(1, filter.length - 1);

      usersInfo(message, db, filter);
    }, (errorObject) => {
      console.log('The read failed: ' + errorObject.code);
github satokaz / vscode-memo-life-for-you / src / memoNew.ts View on Github external
public QuickNew() {
        this.readConfig();

        let file: string = path.normalize(path.join(this.memodir, dateFns.format(new Date(), 'YYYY-MM-DD') + ".md"));
        let date: Date = new Date();
        let dateFormat = this.memoDateFormat;
        let getISOWeek = this.memoISOWeek == true ? "[Week: " + dateFns.getISOWeek(new Date()) + "/" + dateFns.getISOWeeksInYear(new Date()) + "] " : "";
        let getEmoji = this.memoEmoji == true ? randomEmoji.random().emoji : "";

        // console.log(getISOWeek);
        // console.log(getEmoji);

        fs.stat(file, async (err, files) => {
            if (err) {
                await fs.writeFile(file, "# " + dateFns.format(new Date(), `${dateFormat}`) + os.EOL + os.EOL, (err) => {
                    if (err) throw err;
                });
            }
        });

        // ้ธๆŠžใ•ใ‚Œใฆใ„ใ‚‹ใƒ†ใ‚ญใ‚นใƒˆใ‚’ๅ–ๅพ—
        // ใ‚จใƒ‡ใ‚ฃใ‚ฟใŒไธ€ใคใ‚‚็„กใ„ๅ ดๅˆใฏใ€ใ‚จใƒฉใƒผใซใชใ‚‹ใฎใงๅฏพๅ‡ฆใ—ใฆใŠใ
        let editor = vscode.window.activeTextEditor;
        let selectString: String = editor ? editor.document.getText(editor.selection) : "";
github bjork24 / google-calendar-slack-status / index.js View on Github external
if (!req.body.token || req.body.token !== process.env.SECRET_TOKEN) {
    next();
    return;
  }
  // store token
  const token = process.env.SLACK_TOKEN;
  // log some stuff for dev
  console.log(req.body);
  // grab status and emojis and clean it up
  let status = req.body.title;
  let statusEmoji = nodeEmoji.unemojify('๐Ÿ—“');
  const statusHasEmoji = emojiRegex().exec(status);
  if (statusHasEmoji) {
    statusEmoji = nodeEmoji.unemojify(statusHasEmoji[0]);
    console.log(`CUSTOM EMOJI! ${statusEmoji}`);
    status = nodeEmoji.strip(status);
  }
  // additional tokens
  const dndToken = '[DND]';
  const awayToken = '[AWAY]';
  // parse event start/stop time
  const dateFormat = 'MMM D, YYYY [at] hh:mmA';
  const start = moment(req.body.start, dateFormat);
  const end = moment(req.body.end, dateFormat);
  // check for DND
  if (status.includes(dndToken)) {
    slack.dnd.setSnooze({
      token,
      num_minutes: end.diff(start, 'minutes')
    });
    status = status.replace(dndToken, '').trim();
  }