{"_id":"@aditya1301/greeting-module","_rev":"4-a8cc33b90f7e189a0868a0891a9e1144","name":"@aditya1301/greeting-module","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@aditya1301/greeting-module","version":"1.0.0","keywords":["greeting","hello","multilingual","utility"],"author":{"name":"Yogesh Erande"},"license":"MIT","_id":"@aditya1301/greeting-module@1.0.0","maintainers":[{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"}],"homepage":"https://github.com/YOUR_USERNAME/greeting-module#readme","bugs":{"url":"https://github.com/YOUR_USERNAME/greeting-module/issues"},"dist":{"shasum":"2d9076666f06098871ccfaeb69eb0564cc2f2239","tarball":"https://registry.npmjs.org/@aditya1301/greeting-module/-/greeting-module-1.0.0.tgz","fileCount":2,"integrity":"sha512-dEfJNAIbJts4wx7V1MbkvWNLeajddMgcZXLSod1TyNsz7aWEUfvJ5YVOgQOLpOQOUMjhKwtMqt+dU2WYpDJU0g==","signatures":[{"sig":"MEYCIQD8s7a8K1spJQ3cEhkU94wkJQTcs9o5K30Z/NhEON6EswIhAL2foaedZzL6hEKEzq0kCwfLSDj8mMpOS9XBeLBSlwJy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1843},"main":"src/index.js","scripts":{"test":"node test/index.test.js"},"_npmUser":{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"},"repository":{"url":"git+https://github.com/YOUR_USERNAME/greeting-module.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight greeting utility — say hello, good morning, and goodbye in multiple languages.","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/greeting-module_1.0.0_1777968441037_0.7054738987682534","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aditya1301/greeting-module","version":"1.0.1","keywords":["greeting","hello","multilingual","utility"],"author":{"name":"Yogesh Erande"},"license":"MIT","_id":"@aditya1301/greeting-module@1.0.1","maintainers":[{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"}],"homepage":"https://github.com/YOUR_USERNAME/greeting-module#readme","bugs":{"url":"https://github.com/YOUR_USERNAME/greeting-module/issues"},"dist":{"shasum":"f99b25ae4bf50c51283be405cba3cc858affba7a","tarball":"https://registry.npmjs.org/@aditya1301/greeting-module/-/greeting-module-1.0.1.tgz","fileCount":3,"integrity":"sha512-RNK+CICkCRdyHP47m456znMYht8iKvJiVsZ+IxgfgW738hLegL5h948ybJ7GPBJe23xxQq2dqo9jaYEawdDCQA==","signatures":[{"sig":"MEUCIQCz6RBVEsxuG/30RruXGz/Jo6EYrOQNZqfOwtqzPjCWCAIgQu+toqtC0sWVwFT2oTs2oHCv7GhO9WO3dPxQB1ZSPsA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3174},"main":"src/index.js","scripts":{"test":"node test/index.test.js"},"_npmUser":{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"},"repository":{"url":"git+https://github.com/YOUR_USERNAME/greeting-module.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight greeting utility — say hello, good morning, and goodbye in multiple languages.","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/greeting-module_1.0.1_1777987524921_0.6690771317339992","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aditya1301/greeting-module","version":"1.1.0","keywords":["greeting","hello","multilingual","chatbot","theming","ui"],"author":{"name":"Yogesh Erande"},"license":"MIT","_id":"@aditya1301/greeting-module@1.1.0","maintainers":[{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"}],"homepage":"https://github.com/YOUR_USERNAME/greeting-module#readme","bugs":{"url":"https://github.com/YOUR_USERNAME/greeting-module/issues"},"dist":{"shasum":"f888236f7de37182f40fc390480dfdb7e77a1164","tarball":"https://registry.npmjs.org/@aditya1301/greeting-module/-/greeting-module-1.1.0.tgz","fileCount":7,"integrity":"sha512-B47XmtEJrxpdMYLIMwp8+16AM7STercQtr/iqWv0EhkY2P/nNKj0tvQQlIBzOwRMaYkEuja4U46kfkdIWS47WQ==","signatures":[{"sig":"MEUCIDj3Cob50Ka4cXkt5rGoUt0ULjbRt26+gxW+cd98jvZvAiEAyh7Zb0x85fA6VdVHbouZdTJ4Sgo9F1RND2M0hjHJj+U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27983},"main":"src/index.js","engines":{"node":">=14"},"scripts":{"demo":"npm run build && npx serve . --listen 3000","test":"node test/index.test.js","build":"npx browserify browser-entry.js -o bundle.js","prepublishOnly":"npm test"},"_npmUser":{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"},"repository":{"url":"git+https://github.com/YOUR_USERNAME/greeting-module.git","type":"git"},"_npmVersion":"10.8.2","description":"A greeting chatbot with multilingual utilities, 4 built-in themes, and a plug-and-play DOM chat widget. Optionally extend with any LLM SDK.","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"browserify":"^17.0.1"},"peerDependencies":{"@anthropic-ai/sdk":">=0.39.0"},"peerDependenciesMeta":{"@anthropic-ai/sdk":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/greeting-module_1.1.0_1777990074421_0.34575625529133314","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@aditya1301/greeting-module","version":"1.2.0","description":"A greeting chatbot with multilingual utilities, 4 built-in themes, and a plug-and-play DOM chat widget. Optionally extend with any LLM SDK.","main":"src/index.js","scripts":{"test":"node test/index.test.js","build":"npx browserify browser-entry.js -o bundle.js","demo":"npm run build && npx serve . --listen 3000","prepublishOnly":"npm test"},"keywords":["greeting","hello","multilingual","chatbot","theming","ui"],"author":{"name":"Yogesh Erande"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/YOUR_USERNAME/greeting-module.git"},"engines":{"node":">=14"},"peerDependencies":{"@anthropic-ai/sdk":">=0.39.0"},"peerDependenciesMeta":{"@anthropic-ai/sdk":{"optional":true}},"devDependencies":{"browserify":"^17.0.1"},"_id":"@aditya1301/greeting-module@1.2.0","bugs":{"url":"https://github.com/YOUR_USERNAME/greeting-module/issues"},"homepage":"https://github.com/YOUR_USERNAME/greeting-module#readme","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-CKwu3NYDhHC9mFIJT7Rg7CpYVj60R6a1WzbZ3PV+DqkSu7DC7QckzyE7qfwhVv0mXaYn/rG9SOnJpg9g5ZhnfA==","shasum":"69184d600377ae596f2f05e81fbf3345b631fbf1","tarball":"https://registry.npmjs.org/@aditya1301/greeting-module/-/greeting-module-1.2.0.tgz","fileCount":11,"unpackedSize":58505,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHoR/0RLGquYN4+g66AmY03gwu32NKUTJmJo1045ZxDeAiEAgmwKReXST6g78Ea6SWjWNNKAMK7+GrSGcBUxcEYZm/8="}]},"_npmUser":{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"},"directories":{},"maintainers":[{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/greeting-module_1.2.0_1778050635412_0.9469404831374426"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-05T08:07:20.925Z","modified":"2026-05-06T06:57:15.646Z","1.0.0":"2026-05-05T08:07:21.176Z","1.0.1":"2026-05-05T13:25:25.065Z","1.1.0":"2026-05-05T14:07:54.555Z","1.2.0":"2026-05-06T06:57:15.545Z"},"bugs":{"url":"https://github.com/YOUR_USERNAME/greeting-module/issues"},"author":{"name":"Yogesh Erande"},"license":"MIT","homepage":"https://github.com/YOUR_USERNAME/greeting-module#readme","keywords":["greeting","hello","multilingual","chatbot","theming","ui"],"repository":{"type":"git","url":"git+https://github.com/YOUR_USERNAME/greeting-module.git"},"description":"A greeting chatbot with multilingual utilities, 4 built-in themes, and a plug-and-play DOM chat widget. Optionally extend with any LLM SDK.","maintainers":[{"name":"aditya1301","email":"aditya.ranaware@thinkitive.com"}],"readme":"# @aditya1301/greeting-module\n\nA greeting chatbot with multilingual utilities, 4 built-in themes, and a plug-and-play DOM chat widget.  \nWorks out of the box with **static responses** — no API key required.  \nOptionally wire in **any LLM** (Claude, OpenAI, custom) via a single `handler` function.\n\n---\n\n## Installation\n\n```bash\nnpm install @aditya1301/greeting-module\n```\n\n---\n\n## Quick Start\n\n### Node.js — static chatbot (no API key)\n\n```js\nconst { ChatbotClient } = require('@aditya1301/greeting-module');\n\nconst bot = new ChatbotClient();\n\nconst reply = await bot.sendMessage('Hello!');\nconsole.log(reply); // \"Hello there! Great to meet you! 😊\"\n```\n\n### Browser — DOM chat widget (no API key)\n\n```js\nconst { ChatbotUI } = require('@aditya1301/greeting-module');\n\nconst chat = new ChatbotUI({ theme: 'ocean' });\nchat.mount('#app'); // appends the chat widget into <div id=\"app\">\n```\n\n---\n\n## SDK Override — plug in any LLM\n\nThe `handler` option lets you replace the static engine with any LLM.  \nThe handler receives `(text, history, systemPrompt)` and must return a `Promise<string>`.\n\n### Claude (Anthropic SDK)\n\n```bash\nnpm install @anthropic-ai/sdk\n```\n\n```js\nconst Anthropic = require('@anthropic-ai/sdk');\nconst { ChatbotClient } = require('@aditya1301/greeting-module');\n\nconst anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });\n\nasync function claudeHandler(text, history, systemPrompt) {\n  const response = await anthropic.messages.create({\n    model: 'claude-haiku-4-5',\n    max_tokens: 512,\n    system: [\n      {\n        type: 'text',\n        text: systemPrompt,\n        cache_control: { type: 'ephemeral' }, // prompt caching\n      },\n    ],\n    messages: history,\n  });\n  return response.content\n    .filter(b => b.type === 'text')\n    .map(b => b.text)\n    .join('');\n}\n\nconst bot = new ChatbotClient({ handler: claudeHandler });\nconst reply = await bot.sendMessage('Good morning!');\nconsole.log(reply);\n```\n\n### OpenAI SDK\n\n```bash\nnpm install openai\n```\n\n```js\nconst OpenAI = require('openai');\nconst { ChatbotClient } = require('@aditya1301/greeting-module');\n\nconst openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });\n\nasync function openAIHandler(text, history, systemPrompt) {\n  const messages = [\n    { role: 'system', content: systemPrompt },\n    ...history,\n  ];\n  const response = await openai.chat.completions.create({\n    model: 'gpt-4o-mini',\n    messages,\n  });\n  return response.choices[0].message.content;\n}\n\nconst bot = new ChatbotClient({ handler: openAIHandler });\n```\n\n### Custom / local model\n\n```js\nconst { ChatbotClient } = require('@aditya1301/greeting-module');\n\nasync function myHandler(text, history, systemPrompt) {\n  const res = await fetch('http://localhost:11434/api/chat', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({\n      model: 'llama3',\n      messages: [{ role: 'system', content: systemPrompt }, ...history],\n    }),\n  });\n  const data = await res.json();\n  return data.message.content;\n}\n\nconst bot = new ChatbotClient({ handler: myHandler });\n```\n\n---\n\n## ChatbotUI — browser widget with SDK override\n\nPass the same `handler` to `ChatbotUI` for a fully LLM-powered widget:\n\n```js\nconst { ChatbotUI } = require('@aditya1301/greeting-module');\n\nconst chat = new ChatbotUI({\n  theme: 'dark',\n  handler: claudeHandler, // any async handler from above\n  title: 'AI Assistant',\n});\nchat.mount('#app');\n```\n\n---\n\n## Themes\n\nFour built-in themes. Pass by name or a custom object.\n\n| Name | Colors |\n|------|--------|\n| `default` | Red header + white background |\n| `dark` | Purple + dark navy background |\n| `ocean` | Blue + light cyan background |\n| `sunset` | Orange + warm cream background |\n\n```js\n// By name\nconst chat = new ChatbotUI({ theme: 'ocean' });\n\n// Switch theme at runtime\nchat.setTheme('sunset');\n\n// Custom theme (deep-merged over default)\nchat.setTheme({\n  colors: {\n    primary: '#10b981',\n    headerBg: '#10b981',\n    userBubble: '#10b981',\n  },\n  borderRadius: '4px',\n});\n```\n\n---\n\n## API Reference\n\n### `ChatbotClient(options?)`\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `handler` | `async (text, history, systemPrompt) => string` | `null` | LLM handler. If omitted, uses static responses. |\n| `systemPrompt` | `string` | Built-in greeting prompt | System prompt passed to the handler. |\n| `starterMessages` | `Array` | `[{ role: 'assistant', content: '...' }]` | Initial messages shown in history. |\n\n**Methods**\n\n| Method | Returns | Description |\n|--------|---------|-------------|\n| `sendMessage(text)` | `Promise<string>` | Send a message, get a reply. |\n| `getHistory()` | `Array` | Returns a copy of the current conversation history. |\n| `clearHistory(keepStarter?)` | `void` | Resets history. Pass `false` to clear everything. |\n\n---\n\n### `ChatbotUI(options?)`\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `theme` | `string \\| Object` | `'default'` | Theme name or custom theme object. |\n| `handler` | `Function` | `null` | Same as `ChatbotClient.handler`. |\n| `systemPrompt` | `string` | Built-in | Override system prompt. |\n| `starterMessages` | `Array` | Built-in | Override starter messages. |\n| `title` | `string` | `'Greeting Assistant'` | Header title text. |\n| `placeholder` | `string` | `'Type a message…'` | Input placeholder text. |\n\n**Methods**\n\n| Method | Description |\n|--------|-------------|\n| `mount(el)` | Append widget to a DOM element or CSS selector string. |\n| `setTheme(nameOrObj)` | Swap theme at runtime and rebuild the widget in place. |\n\n---\n\n### Sync utilities\n\n```js\nconst { greet, greetByTime, farewell } = require('@aditya1301/greeting-module');\n\ngreet('Alice');            // \"Hello, Alice!\"\ngreet('Carlos', 'es');    // \"¡Hola, Carlos!\"\ngreetByTime('Bob');       // \"Good morning, Bob!\" (based on system clock)\nfarewell('Alice');        // \"Goodbye, Alice! Have a great day.\"\n```\n\nSupported language codes: `en`, `es`, `fr`, `hi`, `de`\n\n---\n\n## Running locally (development)\n\n```bash\n# Install dev deps\nnpm install\n\n# Build the browser bundle\nnpm run build\n\n# Start demo server at http://localhost:3000/demo.html\nnpm run demo\n```\n","readmeFilename":"README.md"}