#!/usr/bin/env node /*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//* https://github.com/twitter/twemoji/blob/gh-pages/LICENSE */ // dependencies var fs = require('fs'); var path = require('path'); var Utils = require('./utils'); var regex = new RegExp(fs.readFileSync(file('scripts/regex')).toString(), 'g'); function countEmoji(emoji) { var count = 0; regex.lastIndex = 0; while (regex.exec(emoji)) { count++; } return count; } function file(which) { return path.join(__dirname, '..', which); } fs.readdir(file('assets'), function (err, files) { var page = fs.readFileSync(file('templates/preview.html')).toString().replace( '{{emoji-list}}', '