notes-of-encouragement 2.0.9
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/LICENSE +21 -0
- package/README.md +46 -0
- package/bin/index.js +29 -0
- package/bin/notes.json +43 -0
- package/cli-app-example.png +0 -0
- package/eslint.config.js +8 -0
- package/package.json +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 David Neal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Notes of Encouragement
|
|
2
|
+
|
|
3
|
+
This is a command-line interface (CLI) application written in Node.js that displays one random note of encouragement each time it is run.
|
|
4
|
+
|
|
5
|
+
I wrote this application for my son, so he can always get a note of encouragement from me whenever he needs one. You don't even need to be connected to the Internet!
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Modifying For Someone Special in Your Life
|
|
10
|
+
|
|
11
|
+
If you want to use this application for someone special, you can update the following using a good editor like [Visual Studio Code](https://code.visualstudio.com):
|
|
12
|
+
|
|
13
|
+
* `/bin/notes.json`: this contains a JavaScript object with an array of introductions and an array of notes.
|
|
14
|
+
* `/package.json`: change the `/bin` to be whatever command you want. Right now it's set to `heybuddy`. Change yours to `heygirl`, `heyprincess`, `hi-beautiful`, or whatever you wish!
|
|
15
|
+
|
|
16
|
+
## Installing on Someone's Computer
|
|
17
|
+
|
|
18
|
+
1. Download and install [node.js](https://nodejs.org).
|
|
19
|
+
1. Download, extract, and modify this source code, or copy all the modified source code from your computer to a folder on their computer.
|
|
20
|
+
1. Open up a terminal/command window.
|
|
21
|
+
1. Change to the directory where the source code files are located.
|
|
22
|
+
1. Run the following command to install dependencies and install it as a CLI app.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install
|
|
26
|
+
npm install -g .
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Last, add instructions to your loved one's computer to open up a terminal/command prompt window and type `heybuddy` (or whatever you defined as your app in the `package.json` file).
|
|
30
|
+
|
|
31
|
+
Hope this helps you touch someone's heart and let them know you love them! ❤
|
|
32
|
+
|
|
33
|
+
## Updating
|
|
34
|
+
|
|
35
|
+
1. Modify the source code to add/remove notes.
|
|
36
|
+
1. Reinstall the CLI app same as installing it before.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install -g .
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Uninstalling
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm uninstall -g notes-of-encouragement
|
|
46
|
+
```
|
package/bin/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import boxen from "boxen";
|
|
6
|
+
|
|
7
|
+
const __dirname = import.meta.dirname;
|
|
8
|
+
|
|
9
|
+
const boxenOptions = {
|
|
10
|
+
padding: 1,
|
|
11
|
+
margin: 0,
|
|
12
|
+
borderStyle: "round",
|
|
13
|
+
borderColor: "green"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getRandomIndex( max ) {
|
|
17
|
+
return Math.floor( Math.random() * max );
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
const text = await fs.readFile( resolve( __dirname, "notes.json" ), { encoding: "utf-8" } );
|
|
22
|
+
const { notes, intros } = JSON.parse( text );
|
|
23
|
+
const randomIntro = intros[getRandomIndex( intros.length )];
|
|
24
|
+
const randomNote = notes[getRandomIndex( notes.length )];
|
|
25
|
+
const message = `${ randomIntro }\n${ randomNote }`;
|
|
26
|
+
console.log( boxen( chalk.bold( message ), boxenOptions ) );
|
|
27
|
+
} catch ( error ) {
|
|
28
|
+
console.error( error );
|
|
29
|
+
}
|
package/bin/notes.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"intros": [
|
|
3
|
+
"Hey buddy, I just want you to know...",
|
|
4
|
+
"Hey buddy, I want you to remember...",
|
|
5
|
+
"Hey buddy, don't ever forget...",
|
|
6
|
+
"Hey buddy, no matter what anyone else says..."
|
|
7
|
+
],
|
|
8
|
+
"notes": [
|
|
9
|
+
"I know you can do it. Don't give up.",
|
|
10
|
+
"You are __so__ special!",
|
|
11
|
+
"You are amazing!",
|
|
12
|
+
"I am so proud of you 😊",
|
|
13
|
+
"You are a pretty good bass player 🎸 😉",
|
|
14
|
+
"God has very special plans for your life!",
|
|
15
|
+
"You are strong 💪",
|
|
16
|
+
"I'm so glad I get to be your Dad!",
|
|
17
|
+
"Don't believe the lies the world keeps throwing at you.",
|
|
18
|
+
"You are smart 🧠",
|
|
19
|
+
"You are brave! 👊",
|
|
20
|
+
"You are uniquely gifted to do incredible things!",
|
|
21
|
+
"Always look for the sacred in the ordinary things.",
|
|
22
|
+
"Treat others with kindness ❤️",
|
|
23
|
+
"There is always something you can be grateful for.",
|
|
24
|
+
"You can change lives by serving others.",
|
|
25
|
+
"You are loved ❤️",
|
|
26
|
+
"You can sing 🎶",
|
|
27
|
+
"You can be someone others can always trust.",
|
|
28
|
+
"Focus on staying pure of heart ❤️",
|
|
29
|
+
"Don't forget to pray 🙏",
|
|
30
|
+
"It's okay to ask for help.",
|
|
31
|
+
"No matter what happens, I will always love you.",
|
|
32
|
+
"I am so blessed you are my son.",
|
|
33
|
+
"Your mistakes do not make you a failure. Learn and grow.",
|
|
34
|
+
"Do good for those around you.",
|
|
35
|
+
"Be patient with yourself.",
|
|
36
|
+
"Forgive others, and be sure to forgive yourself.",
|
|
37
|
+
"Happiness will come and go, but you can always have hope and joy.",
|
|
38
|
+
"I need you. Your family needs you. Your friends need you. The world needs you.",
|
|
39
|
+
"Amazing things are yet to come!",
|
|
40
|
+
"You are not responsible for the actions of others.",
|
|
41
|
+
"Keep a good attitude!"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
Binary file
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config"; // eslint-disable-line n/no-unpublished-import
|
|
2
|
+
import rg from "eslint-config-reverentgeek"; // eslint-disable-line n/no-unpublished-import
|
|
3
|
+
|
|
4
|
+
export default defineConfig( {
|
|
5
|
+
extends: [ rg.configs["node-esm"] ],
|
|
6
|
+
rules: {
|
|
7
|
+
}
|
|
8
|
+
} );
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "notes-of-encouragement",
|
|
3
|
+
"version": "2.0.9",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "bin/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.16"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "David Neal <david@reverentgeek.com> (https://reverentgeek.com)",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"bin": {
|
|
17
|
+
"heybuddy": "./bin/index.js"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"boxen": "^8.0.1",
|
|
21
|
+
"chalk": "^5.6.2"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"eslint": "^9.39.2",
|
|
25
|
+
"eslint-config-reverentgeek": "^6.3.7"
|
|
26
|
+
},
|
|
27
|
+
"packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a"
|
|
28
|
+
}
|