{"id":25027769,"url":"https://github.com/aimable01/1d_numeric_arrays_npm","last_synced_at":"2025-04-13T14:36:58.053Z","repository":{"id":221510166,"uuid":"754575277","full_name":"Aimable01/1d_numeric_arrays_npm","owner":"Aimable01","description":"This is an npm package which has come to simplify almost of the necessary manipulations done on one dimensional numeric arrays.","archived":false,"fork":false,"pushed_at":"2024-03-26T20:19:55.000Z","size":3,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T19:50:03.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aimable01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-08T10:51:52.000Z","updated_at":"2024-11-20T07:48:03.000Z","dependencies_parsed_at":"2025-02-05T19:45:18.698Z","dependency_job_id":"251429f9-91da-4fca-8b10-432e9a64aa8b","html_url":"https://github.com/Aimable01/1d_numeric_arrays_npm","commit_stats":null,"previous_names":["aimable01/1d_numeric_arrays_npm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aimable01%2F1d_numeric_arrays_npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aimable01%2F1d_numeric_arrays_npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aimable01%2F1d_numeric_arrays_npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aimable01%2F1d_numeric_arrays_npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aimable01","download_url":"https://codeload.github.com/Aimable01/1d_numeric_arrays_npm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248729759,"owners_count":21152490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-05T19:38:54.211Z","updated_at":"2025-04-13T14:36:57.902Z","avatar_url":"https://github.com/Aimable01.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nThis is going to simplify coding in javascript when dealing with one dimensional numeric arrays.\n\n## Installation\n\nThis is an npm package so you'll have to install it via the npm\n\n```bash\nnpm install @kwizeraaimable/1d_array\n```\n\n### Usage\n\nThis one has a very simple and easy syntax\n\n```javascript\n//Import the npm package\nconst oneD_arrays_simplified = require(\"@kwizeraaimable/1d_array\");\n\n//A demo array\nconst demoArray = [1, 2, 3, 4, 1, 2, 3, 5, 6, 7, 8, 9];\n\n//the sum\nconst sum = oneD_arrays_simplified.sum(demoArray);\n\n//maximum value in the array\nconst maximum = oneD_arrays_simplified.maximum(demoArray);\n\n//minimum value in the array\nconst minimum = oneD_arrays_simplified.minimum(demoArray);\n\n//the average\nconst average = oneD_arrays_simplified.average(demoArray);\n\n//arrange them in ascending order\nconst ascending = oneD_arrays_simplified.ascending(demoArray);\n\n//arrange them in descending order\nconst descending = oneD_arrays_simplified.descending(demoArray);\n\n//Reverse the order of the values\nconst reverse = oneD_arrays_simplified.reverse(demoArray);\n\n//check if a certain value exists in the array\nconst demoNum = 4;\nconst exists = oneD_arrays_simplified.valueInArr(demoArray, demoNum);\n\n//remove duplicates from the array\nconst noDuplicates = oneD_arrays_simplified.removeDuplicates(demoArray);\n\n//find the index of a value\nconst index = oneD_arrays_simplified.findIndexOf(demoArray, demoNum);\n\n//slice the array\n//get the first 3 values\nconst first3Values = oneD_arrays_simplified.slice(demoArray, 3);\n\n//get the last 4 values, make sure you make the number negative\nconst last4Values = oneD_arrays_simplified.slice(demoArray, -4);\n\n//concatenate 2 arrays\nconst arr1 = [1, 2, 3, 4, 5];\nconst arr2 = [2, 3, 4, 5, 4];\nconst concatenatedArray = oneD_arrays_simplified.concat(arr1, arr2);\n\n//check if all values meet a certain condition\n//this is to check if numbers are even\nconst condition = (n) =\u003e {\n  return n % 2 === 0;\n};\nconst allMeetCondition = oneD_arrays_simplified.satisfyCondition(\n  demoArray,\n  condition\n);\n\n//check if atlease one value meets a given condition\nconst oneMeetsCondition = oneD_arrays_simplified.oneSatisfyCondition(\n  demoArray,\n  condition\n);\n\n//find the index of the last occurrence of a number\nconst lastIndexofValue = oneD_arrays_simplified.lastOccurrenceOf(\n  demoArray,\n  demoNum\n);\n\n//flatten multdimensional arrays into a one dimensional array\nconst multdimensional = [\n  [1, 2, 3, 4],\n  [5, 6, 7, 7],\n];\nconst flattened = oneD_arrays_simplified.flatten(multdimensional);\n```\n\n#### Conclusion\n\nI thank you for choosing to use my package. I wish you goodluck within your coding journey.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimable01%2F1d_numeric_arrays_npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimable01%2F1d_numeric_arrays_npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimable01%2F1d_numeric_arrays_npm/lists"}