{"_id":"10_array_useful_functions","name":"10_array_useful_functions","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"10_array_useful_functions","version":"1.0.0","description":"A utility to perform 10 useful array functions","homepage":"https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package#readme","bugs":{"url":"https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package/issues"},"repository":{"type":"git","url":"git+https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package.git"},"license":"ISC","author":{"name":"Nishu Kumar"},"type":"commonjs","main":"index.js","scripts":{"start":"node index.js"},"_id":"10_array_useful_functions@1.0.0","gitHead":"65616de6907d2e911a45ffcc82e6811123c50862","_nodeVersion":"22.13.1","_npmVersion":"11.2.0","dist":{"integrity":"sha512-aF3/vlEXDPzAfZ6PPlX22cKisZm1hy9rBD33J18EhRjDqPnEOg2YSTUE7HAFAUd4cdnEjMYM626XAPBsOVcW4g==","shasum":"9adcd0be7d37ffec6233d200507a68ea37096559","tarball":"https://registry.npmjs.org/10_array_useful_functions/-/10_array_useful_functions-1.0.0.tgz","fileCount":3,"unpackedSize":6185,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDEKKsxnqYrA4sKfI/i1kH1M9yITzSsf/MMvGjpK6wpwgIhAPQCMryHrko9jhUsYDKlsCIsnP0xgEt8tKy8DeVuDeHP"}]},"_npmUser":{"name":"nishukumar527","email":"nishukumar527@gmail.com"},"directories":{},"maintainers":[{"name":"nishukumar527","email":"nishukumar527@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/10_array_useful_functions_1.0.0_1748388270043_0.6191347597581396"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-27T23:24:30.042Z","1.0.0":"2025-05-27T23:24:30.230Z","modified":"2025-05-27T23:24:30.514Z"},"maintainers":[{"name":"nishukumar527","email":"nishukumar527@gmail.com"}],"description":"A utility to perform 10 useful array functions","homepage":"https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package#readme","repository":{"type":"git","url":"git+https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package.git"},"author":{"name":"Nishu Kumar"},"bugs":{"url":"https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package/issues"},"license":"ISC","readme":"\n# 🔟 Useful Array Functions (NPM Package)\n\n> A lightweight utility package that extends JavaScript arrays with 10 commonly needed, high-performance operations. Perfect for developers looking to simplify array manipulation.\n\n![npm](https://img.shields.io/npm/v/10_array_useful_functions?color=green)\n![GitHub](https://img.shields.io/github/license/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package)\n![GitHub Repo stars](https://img.shields.io/github/stars/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package?style=social)\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install 10_array_useful_functions\n```\n\n---\n\n## 🚀 Usage\n\n```js\nconst {\n  sum,\n  unique,\n  average,\n  max,\n  min,\n  chunk,\n  flatten,\n  compact,\n  groupBy,\n  countBy\n} = require('10_array_useful_functions');\n\nconst arr = [1, 2, 3, 4, 5];\n\nconsole.log(sum(arr));                 // 15\nconsole.log(unique([1, 2, 2, 3]));     // [1, 2, 3]\nconsole.log(average(arr));            // 3\nconsole.log(max(arr));                // 5\nconsole.log(min(arr));                // 1\nconsole.log(chunk(arr, 2));           // [[1, 2], [3, 4], [5]]\nconsole.log(flatten([1, [2, [3]]]));  // [1, 2, 3]\nconsole.log(compact([0, 1, false, 2, '', 3])); // [1, 2, 3]\nconsole.log(groupBy(['one', 'two', 'three'], x => x.length)); // { '3': ['one', 'two'], '5': ['three'] }\nconsole.log(countBy([1.1, 2.5, 2.8], Math.floor)); // { '1': 1, '2': 2 }\n```\n\n---\n\n## 🔧 Available Functions\n\n| Function              | Description                                 |\n|-----------------------|---------------------------------------------|\n| `sum(arr)`            | Returns the sum of array elements           |\n| `unique(arr)`         | Returns a new array with unique values      |\n| `average(arr)`        | Returns the average of all numbers          |\n| `max(arr)`            | Returns the maximum number                  |\n| `min(arr)`            | Returns the minimum number                  |\n| `chunk(arr, size)`    | Breaks array into chunks of given size      |\n| `flatten(arr)`        | Flattens nested arrays into a single array  |\n| `compact(arr)`        | Removes all falsy values                    |\n| `groupBy(arr, cb)`    | Groups elements based on a callback function|\n| `countBy(arr, cb)`    | Counts elements based on a callback function|\n\n---\n\n## 📁 Project Structure\n\n```\n.\n├── index.js               # Main module with all 10 functions\n├── package.json           # NPM metadata and scripts\n├── README.md              # Project documentation\n└── .github/\n    └── workflows/\n        └── publish.yml    # GitHub Action for auto publish\n```\n\n---\n\n## 👨‍💻 Author\n\n**Nishu Kumar**\n\n- 🔗 [GitHub](https://github.com/PyhtonDeveloperNishu/10_Useful_Array_functions_in_package.git)\n- 🔗 [NPM Package](https://www.npmjs.com/package/10_array_useful_functions)\n\n---\n\n## 📜 License\n\nThis project is licensed under the [ISC License](https://opensource.org/licenses/ISC).\n","readmeFilename":"README.md","_rev":"1-a337b0270ee7d539d35fe23333b71140"}