hi_viral 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/me.js +22 -0
  2. package/package.json +16 -0
package/me.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ import https from 'https';
4
+ import chalk from 'chalk';
5
+
6
+ const url = 'https://viralvaghela.com/hi.txt';
7
+
8
+ https.get(url, (response) => {
9
+ let data = '';
10
+
11
+ // A chunk of data has been received.
12
+ response.on('data', (chunk) => {
13
+ data += chunk;
14
+ });
15
+
16
+ // The whole response has been received. Print out the result.
17
+ response.on('end', () => {
18
+ console.log(chalk.green(data));
19
+ });
20
+ }).on('error', (err) => {
21
+ console.log(chalk.red('Error: ' + err.message));
22
+ });
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "hi_viral",
3
+ "version": "1.0.0",
4
+ "description": "this is my intro",
5
+ "main": "me.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "start": "node me.js"
9
+ },
10
+ "author": "viralvaghela",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "axios": "^1.3.4",
14
+ "chalk": "^5.3.0"
15
+ }
16
+ }