lassiecoder 1.0.10 → 1.0.12
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/bin/index.js +13 -42
- package/package.json +1 -2
package/bin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import fs from "fs";
|
|
3
|
+
import fs from "fs";
|
|
4
4
|
import os from "os";
|
|
5
5
|
import ora from 'ora';
|
|
6
6
|
import path from "path";
|
|
@@ -11,47 +11,18 @@ import chalk from "chalk";
|
|
|
11
11
|
import dotenv from 'dotenv';
|
|
12
12
|
import inquirer from "inquirer";
|
|
13
13
|
import cliSpinners from 'cli-spinners';
|
|
14
|
-
import { SecretsManagerClient, GetSecretValueCommand } from "@aws-sdk/client-secrets-manager";
|
|
15
14
|
|
|
16
15
|
dotenv.config();
|
|
17
16
|
|
|
18
|
-
// Create a Secrets Manager client
|
|
19
|
-
const secretsManager = new SecretsManagerClient({ region: process.env.AWS_REGION });
|
|
20
|
-
|
|
21
|
-
// Function to retrieve secrets
|
|
22
|
-
async function getSecrets() {
|
|
23
|
-
try {
|
|
24
|
-
// 'your-secret-id' is ARN or name of the secret
|
|
25
|
-
const command = new GetSecretValueCommand({ SecretId: process.env.SECRET_ID });
|
|
26
|
-
const data = await secretsManager.send(command);
|
|
27
|
-
if ('SecretString' in data) {
|
|
28
|
-
const secret = JSON.parse(data.SecretString);
|
|
29
|
-
return secret;
|
|
30
|
-
}
|
|
31
|
-
} catch (err) {
|
|
32
|
-
console.error("Error retrieving secrets");
|
|
33
|
-
throw err;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Declare a global variable `secrets` to store the retrieved secrets
|
|
38
|
-
let secrets;
|
|
39
|
-
|
|
40
|
-
// Define an asynchronous function named `main` to retrieve secrets
|
|
41
|
-
async function main() {
|
|
42
|
-
try {
|
|
43
|
-
secrets = await getSecrets();
|
|
44
|
-
} catch (err) {
|
|
45
|
-
console.error("Error retrieving secrets");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
17
|
// Create a prompt module for interacting with the user via the command line interface
|
|
50
18
|
const prompt = inquirer.createPromptModule();
|
|
51
19
|
|
|
52
20
|
// Get the desktop directory path based on the operating system
|
|
53
21
|
const desktopDir = path.join(os.homedir(), 'Desktop');
|
|
54
22
|
|
|
23
|
+
// Define a suggestion to use "cmd/ctrl + click" to open/copy links
|
|
24
|
+
const suggestion = [`💡 ${chalk.blue.bold('Suggestion:')} Try using ${chalk.yellow.bold('cmd/ctrl +')} ${chalk.green.bold('click')} on the links above to open/copy`].join("\n");
|
|
25
|
+
|
|
55
26
|
// Create a loader to indicate that the resume is being downloaded
|
|
56
27
|
const loader = ora({
|
|
57
28
|
text: ' Downloading resume',
|
|
@@ -79,8 +50,8 @@ const questions = [
|
|
|
79
50
|
name: `Send me an ${chalk.green.bold("email")}?`,
|
|
80
51
|
value: () => {
|
|
81
52
|
setTimeout(() => {
|
|
82
|
-
open(
|
|
83
|
-
}, 2000);
|
|
53
|
+
open("mailto:sharmapriyanka84510@gmail.com");
|
|
54
|
+
}, 2000);
|
|
84
55
|
console.log(`\n${chalk.green.bold("Done")}, your email client should ${chalk.yellow.bold("open soon")}. \nI'll keep an eye out for your message! ${chalk.bold("👀")}\n`);
|
|
85
56
|
}
|
|
86
57
|
},
|
|
@@ -90,12 +61,12 @@ const questions = [
|
|
|
90
61
|
loader.start();
|
|
91
62
|
axios({
|
|
92
63
|
method: 'get',
|
|
93
|
-
url:
|
|
64
|
+
url: "https://rb.gy/2venms",
|
|
94
65
|
responseType: 'stream'
|
|
95
66
|
})
|
|
96
67
|
.then(function (response) {
|
|
97
68
|
const writer = fs.createWriteStream(path.join(desktopDir, 'lassiecoder-resume.pdf'));
|
|
98
|
-
|
|
69
|
+
|
|
99
70
|
response.data.pipe(writer);
|
|
100
71
|
|
|
101
72
|
writer.on('finish', () => {
|
|
@@ -103,7 +74,7 @@ const questions = [
|
|
|
103
74
|
loader.stop();
|
|
104
75
|
setTimeout(() => {
|
|
105
76
|
open(path.join(desktopDir, 'lassiecoder-resume.pdf'));
|
|
106
|
-
}, 2000);
|
|
77
|
+
}, 2000);
|
|
107
78
|
});
|
|
108
79
|
writer.on('error', (err) => {
|
|
109
80
|
console.error('\nError downloading resume:', err);
|
|
@@ -120,7 +91,7 @@ const questions = [
|
|
|
120
91
|
name: `Schedule a ${chalk.redBright.bold("Meeting")}?`,
|
|
121
92
|
value: () => {
|
|
122
93
|
setTimeout(() => {
|
|
123
|
-
open(
|
|
94
|
+
open("https://rb.gy/6hb965")
|
|
124
95
|
}, 2000);
|
|
125
96
|
console.log(chalk.hex("#4CAF50")(`\nI'm available on ${chalk.yellow("Fridays from 6:00 PM to 6:15 PM")} for a connection. When scheduling a meeting, please include the ${chalk.yellow("subject")} of our discussion. \nLooking forward to meeting you at the scheduled time! 🗓️\n \n`));
|
|
126
97
|
}
|
|
@@ -157,8 +128,6 @@ const data = {
|
|
|
157
128
|
intro: chalk.white.bold("I am Priyanka Sharma, a Software Developer known by the handle ") + chalk.hex("#7B68EE")("lassiecoder") + chalk.white.bold(" across various tech platforms. My expertise lies in developing both mobile and web solutions."),
|
|
158
129
|
};
|
|
159
130
|
|
|
160
|
-
// main();
|
|
161
|
-
|
|
162
131
|
// Concatenate data strings to display in the console output
|
|
163
132
|
const newline = "\n";
|
|
164
133
|
const working = `${data.work}`;
|
|
@@ -184,4 +153,6 @@ const output =
|
|
|
184
153
|
// Display the formatted output in a box and prompt the user with the defined questions then execute the action based on the user's choice
|
|
185
154
|
console.log(chalk.white(boxen(output, options)));
|
|
186
155
|
|
|
187
|
-
|
|
156
|
+
console.log(`\n`, suggestion, `\n`);
|
|
157
|
+
|
|
158
|
+
prompt(questions).then(answer => answer.action());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lassiecoder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Priyanka's introduction on terminal.",
|
|
5
5
|
"exports": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"bin/index.js"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@aws-sdk/client-secrets-manager": "^3.533.0",
|
|
36
35
|
"axios": "^1.6.7",
|
|
37
36
|
"boxen": "^7.1.0",
|
|
38
37
|
"chalk": "^5.3.0",
|