skilltap 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +57 -0
- package/package.json +17 -0
package/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getskill - A simple demo package
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get a random skill from a predefined list
|
|
7
|
+
* @returns {string} A random skill name
|
|
8
|
+
*/
|
|
9
|
+
function getRandomSkill() {
|
|
10
|
+
const skills = [
|
|
11
|
+
'JavaScript',
|
|
12
|
+
'TypeScript',
|
|
13
|
+
'React',
|
|
14
|
+
'Vue',
|
|
15
|
+
'Node.js',
|
|
16
|
+
'Python',
|
|
17
|
+
'Go',
|
|
18
|
+
'Rust',
|
|
19
|
+
'Docker',
|
|
20
|
+
'Kubernetes'
|
|
21
|
+
];
|
|
22
|
+
return skills[Math.floor(Math.random() * skills.length)];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get all available skills
|
|
27
|
+
* @returns {string[]} Array of skill names
|
|
28
|
+
*/
|
|
29
|
+
function getAllSkills() {
|
|
30
|
+
return [
|
|
31
|
+
'JavaScript',
|
|
32
|
+
'TypeScript',
|
|
33
|
+
'React',
|
|
34
|
+
'Vue',
|
|
35
|
+
'Node.js',
|
|
36
|
+
'Python',
|
|
37
|
+
'Go',
|
|
38
|
+
'Rust',
|
|
39
|
+
'Docker',
|
|
40
|
+
'Kubernetes'
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a skill exists in the list
|
|
46
|
+
* @param {string} skill - The skill to check
|
|
47
|
+
* @returns {boolean} Whether the skill exists
|
|
48
|
+
*/
|
|
49
|
+
function hasSkill(skill) {
|
|
50
|
+
return getAllSkills().map(s => s.toLowerCase()).includes(skill.toLowerCase());
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
module.exports = {
|
|
54
|
+
getRandomSkill,
|
|
55
|
+
getAllSkills,
|
|
56
|
+
hasSkill
|
|
57
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skilltap",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A simple utility to get random programming skills",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "node -e \"const s = require('./index.js'); console.log(s.getRandomSkill())\""
|
|
8
|
+
},
|
|
9
|
+
"keywords": ["skill", "random", "programming", "demo"],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"type": "commonjs",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": ""
|
|
16
|
+
}
|
|
17
|
+
}
|