{"_id":"@diyawanna/my-first-package","_rev":"2-0f38e6485ee14ff4b1f60bc7817377ba","name":"@diyawanna/my-first-package","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@diyawanna/my-first-package","version":"1.0.0","keywords":["Diyawanna","Test","first"],"author":{"name":"@wsmr"},"license":"MIT","_id":"@diyawanna/my-first-package@1.0.0","maintainers":[{"name":"diyawanna","email":"wije.sahan@gmail.com"}],"homepage":"https://github.com/Diyawanna/my-first-package#readme","bugs":{"url":"https://github.com/Diyawanna/my-first-package/issues"},"dist":{"shasum":"2d3ab71db6f1df109b8a95933ea4ddea2c3a454c","tarball":"https://registry.npmjs.org/@diyawanna/my-first-package/-/my-first-package-1.0.0.tgz","fileCount":3,"integrity":"sha512-wpRtvKsJzIVGH5GH3LOxHXccbYjZ76i8JoXevk//uYsWr2L2AOX1d+Ic1kDK/lJLg7ThpaMYQaHt7fwzUkbG9g==","signatures":[{"sig":"MEQCIDQJsTxVWBZB8j7Ud0gm1BMPGI2rBhXjIsemkabzag9tAiBDauBoIkqGcA5e2Yp971iiNEKFpChyJmrKF28YRsMrvg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":883},"main":"index.js","type":"module","types":"index.d.ts","gitHead":"1182c11bbf264a94449741e211585ba591437af1","scripts":{"test":"echo \"No tests yet\""},"_npmUser":{"name":"diyawanna","email":"wije.sahan@gmail.com"},"repository":{"url":"git+https://github.com/Diyawanna/my-first-package.git","type":"git"},"_npmVersion":"10.9.2","description":"My first npm test package","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/my-first-package_1.0.0_1748665207330_0.3215546304172501","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@diyawanna/my-first-package","version":"1.0.1","description":"My first npm test package","main":"index.js","types":"index.d.ts","type":"module","scripts":{"test":"echo \"No tests yet\""},"repository":{"type":"git","url":"git+https://github.com/Diyawanna/my-first-package.git"},"keywords":["Diyawanna","Test","first"],"author":{"name":"@wsmr"},"license":"MIT","bugs":{"url":"https://github.com/Diyawanna/my-first-package/issues"},"homepage":"https://github.com/Diyawanna/my-first-package#readme","_id":"@diyawanna/my-first-package@1.0.1","gitHead":"1182c11bbf264a94449741e211585ba591437af1","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-olgkfsIxkdUP1TcUbLm9JZDioWIfMLjOyuzeb+wOQBunLtbQBbMX2MXRE0y+pBdsCXGmubKTaukH7o5HpS7FbA==","shasum":"c4b00bff3524accdfdbd57a1dd75c07171f44fd1","tarball":"https://registry.npmjs.org/@diyawanna/my-first-package/-/my-first-package-1.0.1.tgz","fileCount":4,"unpackedSize":6953,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCTXkJjFsUgWF1Ef4XnbYuwuPvyk2But21tiLWKNWgg5gIgMk148Lzor7K4cCaynFVkK4qGOttGKqH+1m/J8AcO2D0="}]},"_npmUser":{"name":"diyawanna","email":"wije.sahan@gmail.com"},"directories":{},"maintainers":[{"name":"diyawanna","email":"wije.sahan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/my-first-package_1.0.1_1748666175557_0.14427325295508298"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-31T04:20:07.269Z","modified":"2025-05-31T04:36:15.964Z","1.0.0":"2025-05-31T04:20:07.491Z","1.0.1":"2025-05-31T04:36:15.758Z"},"bugs":{"url":"https://github.com/Diyawanna/my-first-package/issues"},"author":{"name":"@wsmr"},"license":"MIT","homepage":"https://github.com/Diyawanna/my-first-package#readme","keywords":["Diyawanna","Test","first"],"repository":{"type":"git","url":"git+https://github.com/Diyawanna/my-first-package.git"},"description":"My first npm test package","maintainers":[{"name":"diyawanna","email":"wije.sahan@gmail.com"}],"readme":"<!-- 🧪 Step 1: Create Your Package Project\n\nmkdir my-first-package\ncd my-first-package\nnpm init --scope=@diyawanna\nFill out the prompts (or use -y for default).\n\nThis will create a package.json with a scoped name like \"name\": \"@diyawanna/my-first-package\"\n\n{\n  \"name\": \"@diyawanna/my-first-package\",\n  \"version\": \"1.0.0\",\n  \"description\": \"My first npm test package\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"No tests yet\\\"\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Diyawanna/my-first-package.git\"\n  },\n  \"keywords\": [\n    \"Diyawanna\",\n    \"Test\",\n    \"first\"\n  ],\n  \"author\": \"@wsmr\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/Diyawanna/my-first-package/issues\"\n  },\n  \"homepage\": \"https://github.com/Diyawanna/my-first-package#readme\"\n}\n\n\n\n\n\n✍️ Step 2: Write Your Package Code\nCreate a file called index.js:\n\n// index.js\nfunction sayHello(name) {\n  return `Hello, ${name}! From @diyawanna package.`;\n}\nmodule.exports = { sayHello };\n\n**** SEE -> https://github.com/Diyawanna/my-first-package/commits/main/\n\n\n\n\n\n📦 Step 3: Update package.json (Optional Enhancements)\nMake sure your package.json looks something like this:\n\n{\n  \"name\": \"@diyawanna/my-first-package\",\n  \"version\": \"1.0.0\",\n  \"description\": \"My first npm test package\",\n  \"main\": \"index.js\",\n  \"keywords\": [\"hello\", \"diyawanna\", \"test\"],\n  \"author\": \"Your Name\",\n  \"license\": \"MIT\"\n}\n\n\n\n\n🔍 Step 4: Test the Package Locally (Optional)\nBefore publishing, you can test it locally:\nnpm link\n\nIn another project:\nnpm link @diyawanna/my-first-package\n\nThen use it like this:\nconst { sayHello } = require('@diyawanna/my-first-package');\nconsole.log(sayHello(\"World\"));\n\n\n\n**** SEE -> https://github.com/Diyawanna/my-first-package/commits/main/\nA.\ncd /path/to/my-first-package\nnpm link\nB.\ncd /path/to/my-ionic-app\nnpm link @diyawanna/my-first-package\nionic serve\nC.\nimport { sayHello } from '@diyawanna/my-first-package';\nconsole.log(sayHello('Diyawanna'));\n\nIf it's TypeScript, make sure to build it first:\nAdd tsconfig.json if needed.\n\nBuild it:\ntsc\nThen link the compiled output (dist/index.js or similar).\n\nD.\nIf You Update the Package\nTo see changes reflected in the app:\nRebuild your package (e.g. tsc if using TS).\nIt automatically updates in the linked project — no need to reinstall.\n\nE.\nWhen You’re Done\nTo unlink and restore the original:\ncd /path/to/my-ionic-app\nnpm unlink @diyawanna/my-first-package\nnpm install  # to restore other packages if needed\n\n\n\n\n\n\n🚀 Step 5: Publish to NPM\nIf it's a public package:\n\nnpm publish --access public\n🔐 Without --access public, scoped packages are private by default, which requires a paid plan.\n\n\n\n\n🧪 Step 6: Install & Use It Anywhere\nAfter publishing, try installing it from any project:\n\nnpm i @diyawanna/my-first-package\nUse it:\n\nconst { sayHello } = require('@diyawanna/my-first-package');\nconsole.log(sayHello(\"Diyawanna\"));\n\n\n\n\n✅ Summary\nStep\tDescription\nnpm init --scope=@diyawanna\tInitializes a scoped package\nnpm publish --access public\tPublishes it under your npm profile\nnpm i @diyawanna/your-package\tHow others will install it\n -->\n\n\n# 📦 @diyawanna/my-first-package\n\n> My first NPM test package — a simple utility that says hello 👋  \n> Published by [@diyawanna](https://www.npmjs.com/~diyawanna)\n\n---\n\n## ✨ Features\n\n- 🔹 Lightweight and easy to use\n- 🔹 Returns a custom greeting\n- 🔹 Useful as a base template for future NPM packages\n\n---\n\n## 🚀 Installation\n\nInstall the package via NPM:\n\n```bash\nnpm install @diyawanna/my-first-package\n```\n\n## 🔧 Usage\n\n### In JavaScript (CommonJS)\n\n```js\nconst { sayHello } = require('@diyawanna/my-first-package');\n\nconsole.log(sayHello(\"World\"));\n// Output: Hello, World! From @diyawanna package.\n```\n\n### In TypeScript / ES Modules\n\n```ts\nimport { sayHello } from '@diyawanna/my-first-package';\n\nconsole.log(sayHello('Diyawanna'));\n// Output: Hello, Diyawanna! From @diyawanna package.\n```\n\n## 🔍 Local Development & Testing\n\n### A. Link the Package Locally\n\nIn your package directory:\n\n```bash\nnpm link\n```\n\nIn your consuming project (e.g., Ionic or Laravel):\n\n```bash\nnpm link @diyawanna/my-first-package\n```\n\n### B. Use in Your Project\n\n**Example for Ionic Angular:**\n\n```ts\nimport { sayHello } from '@diyawanna/my-first-package';\n\nconsole.log(sayHello('Ionic App'));\n```\n\n**Example for Laravel (with a frontend build):**\n\n```js\nimport { sayHello } from '@diyawanna/my-first-package';\n\nconsole.log(sayHello('Laravel'));\n```\n\n### C. TypeScript Support (Optional)\n\nIf using TypeScript:\n\n1. Add a `tsconfig.json` file.\n\n2. Compile the source with:\n\n```bash\ntsc\n```\n\n## 🛠️ Development Commands\n\n- 🔧 **Build (if using TypeScript):** `tsc`\n- 🔄 **Link to another project:** `npm link @diyawanna/my-first-package`\n- ❌ **Unlink when done:** `npm unlink @diyawanna/my-first-package`\n\n## 📦 Publishing to NPM\n\nTo publish your package publicly (required for scoped packages like `@diyawanna/*`):\n\n```bash\nnpm publish --access public\n```\n\n> ℹ️ Without `--access public`, scoped packages are private by default.\n\n## 📁 Repository Structure\n\n```\nmy-first-package/\n├── index.js            # Entry point\n├── package.json        # Package metadata\n└── README.md           # This file\n```\n\n## 🧪 Example Function\n\n**index.js**\n\n```js\nfunction sayHello(name) {\n  return `Hello, ${name}! From @diyawanna package.`;\n}\n\nmodule.exports = { sayHello };\n```\n\n## 🐛 Issues & Feedback\n\nHave a suggestion, question, or bug report?\n\n👉 Open an issue on GitHub\n\n## 📄 License\n\nMIT License\n\n## 🙌 Author\n\nMade with ❤️ by @wsmr  \nPublished under the @diyawanna namespace.\n\n## 🔗 Useful Links\n\n- 📦 **NPM Package:** [@diyawanna/my-first-package](https://www.npmjs.com/package/@diyawanna/my-first-package)\n- 💻 **GitHub Repository:** [github.com/Diyawanna/my-first-package](https://github.com/Diyawanna/my-first-package)\n\n---\n\n### ✅ After Saving It\n\n1. Place this in your project root as `README.md`.\n2. Run:\n   ```bash\n   npm publish --access public\n   ```\n\n\n\n","readmeFilename":"README.md"}