Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apple icon add #3

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID: 7000",
"processId": "${command:PickProcess}"
},
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/test/print.js"
}
]
}
46 changes: 41 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
var isWin = process.platform === "win32";
var isWin = process.platform === "win32" || process.argv.slice(-1).includes('window');
const img = {
100: "https://abs.twimg.com/emoji/v2/72x72/1f4af.png",
stop: "https://abs.twimg.com/emoji/v2/72x72/1f64c.png",
mars: 'https://abs.twimg.com/hashflags/MARS_NatGeo_2018/MARS_NatGeo_2018.png'
}

var unicons = {
arrowLeft: "←",
arrowUp: "↑",
arrowRight: "→",
arrowRightBtn: '➡️',
arrowDown: "↓",
check: "✓",
circle: "●",
Expand All @@ -13,13 +19,29 @@ var unicons = {
option: "⌥",
super: "⌘",
shift: "⇧",
warning: "⚠"
warning: "⚠",
sun: '🌞',

apple: "",
100: "https://abs.twimg.com/emoji/v2/72x72/1f4af.png",
stop: img.stop,
// https://unicode.org/reports/tr51/proposed.html#emoji_data
ZDings: '✏',
dog: '🐶',
laughing: '🤣',
rocket: '🚀',
magnify: '🔍',
pi: 'π',
jazz: '🎷',
hearts: "💕",
USflag: "🇺🇸"
};

var win32Cli = {
arrowLeft: "\u2190",
arrowUp: "\u2191",
arrowRight: "\u2192",
arrowRightBtn: '\u{27A1}',
arrowDown: "\u2193",
check: "\u221A",
circle: "\u006F",
Expand All @@ -29,13 +51,27 @@ var win32Cli = {
option: "\u003C",
shift: "\u2191",
super: "\u221E",
warning: "\u0021"
warning: "\u0021",
apple: "\uF8FF",
ZDings: "\u270F",
dog: '\uD83D\uDC36',
laughing: '\uD83E\uDD23',
rocket: '\u{1F680}',
magnify: '\u{1F50D}',
pi: '\u03C0',
sun: '\u{1F31E}',
jazz: '\u{1F3B7}',
hearts: '\u{1F495}',
USflag: '\u{1F1FA}\u{1F1F8}'
};

unicons.cli = function (name) {
var icon = isWin ? win32Cli[name] : unicons[name];

return icon || " "; // degrade gracefully to whitespace
return icon || img[name] || " "; // degrade gracefully to whitespace
};

unicons.img = name => {
return img[name] || ' '
}
unicons.get = icon => unicons.cli(icon)
module.exports = unicons;
248 changes: 248 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
}
],
"main": "lib/index.js",
"jest": {
"setupTestFrameworkScriptFile": "jest-chain",
"testRegex": "test/.*.js"
},
"scripts": {
"test": "node test/print.js",
"test": "npm run mac & npm run window",
"mac": "node --inspect=127.0.0.1:7026 ./node_modules/jest/bin/jest.js --runInBand --watch --env node",
"window": "npm run mac window",
"posttest": "eslint ."
},
"keywords": [
Expand All @@ -32,5 +38,10 @@
"repository": {
"type": "git",
"url": "https://github.com/peerigon/unicons.git"
},
"dependencies": {
"jest": "^23.6.0",
"jest-chain": "^1.0.5",
"unicons": "https://github.com/qcgm1978/unicons.git"
}
}
}
Loading