Browse Source

增加格式

Caner 2 years ago
parent
commit
f78148c6b3
2 changed files with 7 additions and 2 deletions
  1. 2 1
      .gitignore
  2. 5 1
      main.js

+ 2 - 1
.gitignore

@@ -27,4 +27,5 @@ build/Release
 # Dependency directory
 # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
 node_modules
-
+yarn.lock
+emoj

+ 5 - 1
main.js

@@ -100,11 +100,15 @@ const downImg = (url, filepath) => {
 
 (async () => {
   let num = -1
+  const newObj = {}
   for (const key in _emojis) {
     const el = _emojis[key]
-    console.log(el);
+    console.log(key,el);
     num++
     const path = process.cwd() + '/emoj/' + num + '.gif'
+    const v = `<img class='emoji' data-Eid='${key}' src='gif${num}'>`
+    newObj[key] = v
     await downImg(el, path)
   }
+  console.log(newObj)
 })()