@ninjaonsteroids/profile-cli 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/README.md +10 -0
- package/bin/index.js +25 -0
- package/lib/getProfile.js +15 -0
- package/package.json +22 -0
package/README.md
ADDED
package/bin/index.js
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
const fs = require('fs');
|
4
|
+
const path = require('path');
|
5
|
+
const inquirer = require('inquirer');
|
6
|
+
const chalk = require('chalk');
|
7
|
+
|
8
|
+
const PROFILE_PATH = path.join(__dirname, '..', 'profile.json');
|
9
|
+
|
10
|
+
const questions = [
|
11
|
+
{ name: 'name', message: 'Your Full Name:' },
|
12
|
+
{ name: 'github', message: 'GitHub URL:' },
|
13
|
+
{ name: 'linkedin', message: 'LinkedIn URL:' },
|
14
|
+
{ name: 'portfolio', message: 'Portfolio URL:' },
|
15
|
+
{ name: 'twitter', message: 'Twitter URL (optional):' }
|
16
|
+
];
|
17
|
+
|
18
|
+
(async () => {
|
19
|
+
console.log(chalk.cyan.bold('\n🧠Let’s set up your developer profile!\n'));
|
20
|
+
|
21
|
+
const answers = await inquirer.prompt(questions);
|
22
|
+
|
23
|
+
fs.writeFileSync(PROFILE_PATH, JSON.stringify(answers, null, 2));
|
24
|
+
console.log(chalk.green(`\n✅ Profile saved successfully at ${PROFILE_PATH}`));
|
25
|
+
})();
|
@@ -0,0 +1,15 @@
|
|
1
|
+
const fs = require('fs');
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
const PROFILE_PATH = path.join(__dirname, '..', 'profile.json');
|
5
|
+
|
6
|
+
function getProfile() {
|
7
|
+
if (!fs.existsSync(PROFILE_PATH)) {
|
8
|
+
throw new Error('Profile not found. Run "profile-init" to set it up.');
|
9
|
+
}
|
10
|
+
|
11
|
+
const raw = fs.readFileSync(PROFILE_PATH);
|
12
|
+
return JSON.parse(raw);
|
13
|
+
}
|
14
|
+
|
15
|
+
module.exports = getProfile;
|
package/package.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "@ninjaonsteroids/profile-cli",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "A CLI tool to store and access your profile URLs (GitHub, LinkedIn, etc.) from any JS file.",
|
5
|
+
"main": "lib/getProfile.js",
|
6
|
+
"bin": {
|
7
|
+
"profile-init": "./bin/index.js"
|
8
|
+
},
|
9
|
+
"keywords": [
|
10
|
+
"profile",
|
11
|
+
"cli",
|
12
|
+
"npm",
|
13
|
+
"github",
|
14
|
+
"linkedin"
|
15
|
+
],
|
16
|
+
"author": "Your Name",
|
17
|
+
"license": "MIT",
|
18
|
+
"dependencies": {
|
19
|
+
"inquirer": "^9.0.0",
|
20
|
+
"chalk": "^5.0.0"
|
21
|
+
}
|
22
|
+
}
|