@bruce-ollama/hello 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.
Files changed (4) hide show
  1. package/index.d.ts +5 -0
  2. package/index.js +10 -0
  3. package/package.json +17 -0
  4. package/test.js +17 -0
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns a greeting from Ollama.
3
+ * @param name - Name to greet. Defaults to "World".
4
+ */
5
+ export function hello(name?: string): string;
package/index.js ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns a greeting from Ollama.
3
+ * @param {string} [name="World"] - Name to greet.
4
+ * @returns {string} The greeting message.
5
+ */
6
+ function hello(name = "World") {
7
+ return `Hello, ${name}! 🦙 Greetings from Ollama!`;
8
+ }
9
+
10
+ module.exports = { hello };
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@bruce-ollama/hello",
3
+ "version": "1.0.0",
4
+ "description": "A simple greeting utility for Ollama enthusiasts",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "scripts": {
8
+ "test": "node test.js"
9
+ },
10
+ "keywords": [
11
+ "ollama",
12
+ "greeting",
13
+ "hello"
14
+ ],
15
+ "author": "Bruce",
16
+ "license": "MIT"
17
+ }
package/test.js ADDED
@@ -0,0 +1,17 @@
1
+ const { hello } = require("./index");
2
+
3
+ const defaultGreeting = hello();
4
+ console.assert(
5
+ defaultGreeting === "Hello, World! 🦙 Greetings from Ollama!",
6
+ "Default greeting failed"
7
+ );
8
+
9
+ const namedGreeting = hello("Bruce");
10
+ console.assert(
11
+ namedGreeting === "Hello, Bruce! 🦙 Greetings from Ollama!",
12
+ "Named greeting failed"
13
+ );
14
+
15
+ console.log("All tests passed!");
16
+ console.log(defaultGreeting);
17
+ console.log(namedGreeting);