dwkim 0.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/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "dwkim",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "devDependencies": {
6
+ "@types/node": "^20.11.24",
7
+ "typescript": "~5.6.2",
8
+ "@repo/typescript-config": "0.0.0",
9
+ "@repo/database": "1.0.0"
10
+ },
11
+ "dependencies": {
12
+ "boxen": "^8.0.1",
13
+ "chalk": "^5.4.1"
14
+ },
15
+ "scripts": {
16
+ "dev": "npm run build && node dist/index.js",
17
+ "build": "tsc && node script/loadProfile.js"
18
+ }
19
+ }
package/profile.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "cm56dtotk0000rhdwho2wmz7n",
3
+ "name": "김동욱",
4
+ "email": "ollie101@kakao.com",
5
+ "emailVerified": null,
6
+ "title": null,
7
+ "github": null,
8
+ "website": null,
9
+ "bio": null
10
+ }
@@ -0,0 +1,10 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { prisma } from '@repo/database';
4
+
5
+ prisma.user.findFirst().then((user) => {
6
+ fs.writeFileSync(
7
+ path.join(process.cwd(), '/profile.json'),
8
+ JSON.stringify(user, null, 2)
9
+ );
10
+ });
package/src/index.ts ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ import chalk from 'chalk';
4
+ import boxen, { type Options } from 'boxen';
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+
8
+ const profile = JSON.parse(
9
+ fs.readFileSync(path.join(process.cwd(), './profile.json'), 'utf8')
10
+ );
11
+
12
+ const boxenOptions: Options = {
13
+ padding: 1,
14
+ margin: 0,
15
+ borderStyle: 'round',
16
+ borderColor: 'green',
17
+ fullscreen: (width, height) => [width, height - 10],
18
+ };
19
+
20
+ const cardContent = [
21
+ chalk.white.bold(profile.name),
22
+ chalk.white(profile.title),
23
+ chalk.white(profile.bio),
24
+ '',
25
+ chalk.gray.bgWhite('Email: ') + chalk.white(profile.email),
26
+ chalk.gray.bgWhite('GitHub: ') + chalk.white(profile.github),
27
+ chalk.gray.bgWhite('Website: ') + chalk.white(profile.website),
28
+ '',
29
+ chalk.white('Out of box, pay it forward 👋'),
30
+ ].join('\n');
31
+
32
+ // 명함 출력
33
+ console.log(boxen(cardContent, boxenOptions));
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "cm56dtotk0000rhdwho2wmz7n",
3
+ "name": "김동욱",
4
+ "email": "ollie101@kakao.com",
5
+ "emailVerified": null,
6
+ "title": null,
7
+ "github": null,
8
+ "website": null,
9
+ "bio": null
10
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@repo/typescript-config/base.json",
3
+ "compilerOptions": {
4
+ "target": "ES2022",
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "resolveJsonModule": true,
8
+ "outDir": "./dist",
9
+ "types": ["node"]
10
+ },
11
+ "include": ["**/*.ts", "script/loadProfile.js", "src/index.ts"],
12
+ "exclude": ["node_modules", "dist"]
13
+ }