{"id":15065410,"url":"https://github.com/hrishibawane/npjs-basic","last_synced_at":"2025-08-23T06:34:01.685Z","repository":{"id":42856680,"uuid":"260257874","full_name":"hrishibawane/npjs-basic","owner":"hrishibawane","description":"A numpy-like npm package for mathematical array functions and manipulations for js","archived":false,"fork":false,"pushed_at":"2022-12-30T20:18:30.000Z","size":113,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T06:34:19.548Z","etag":null,"topics":["array-manipulations","npm-package","numpy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrishibawane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-30T16:08:20.000Z","updated_at":"2024-05-02T18:38:23.000Z","dependencies_parsed_at":"2023-01-31T15:30:35.281Z","dependency_job_id":null,"html_url":"https://github.com/hrishibawane/npjs-basic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hrishibawane/npjs-basic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrishibawane%2Fnpjs-basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrishibawane%2Fnpjs-basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrishibawane%2Fnpjs-basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrishibawane%2Fnpjs-basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrishibawane","download_url":"https://codeload.github.com/hrishibawane/npjs-basic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrishibawane%2Fnpjs-basic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745677,"owners_count":24813521,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["array-manipulations","npm-package","numpy"],"created_at":"2024-09-25T00:38:04.026Z","updated_at":"2025-08-23T06:34:01.659Z","avatar_url":"https://github.com/hrishibawane.png","language":"JavaScript","readme":"# npjs-basic\n[![npm](https://img.shields.io/npm/v/npjs-basic)](https://www.npmjs.com/package/npjs-basic)\n[![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://www.firsttimersonly.com/)\n\nA numpy-like package for mathematical array functions and manipulations\n\n## Introduction\n\nnpjs is a lightweight JavaScript library providing a subset of Python's numpy package. This package is written in pure Javascript and requires no dependencies. This package also includes some extra functions (\"min_max_normalize\" as of now).\n\n## Usage\n\n```js\nconst np = require('npjs-basic');\n\nlet arr = [[1, 2, 3], [4, 5, 6]];\n\nnp.shape(arr, (err, res) =\u003e {\n    if (err) return console.error(err);\n    console.log(res);\n    // res = [2, 3]\n});\n\nlet flatArr = np.flatten(arr);\n// flatArr = [1, 2, 3, 4, 5, 6]\n```\n\n## Functions\n\n- ```add(listA, listB, callback)``` - returns array of sums of corresponding elements of listA and listB of any dimensions.\n\n- ```arange(start, stop, step)``` - returns evenly spaced values within the half-open interval ```[start, stop)``` with optional step argument.\n\n- ```dot(listA, listB, callbacks)``` - returns dot product of listA and listB.\n\n- ```flatten(list)``` - returns 1-D representation of any shape and any levels of nesting of list array.\n\n- ```full(shape_array, val)``` - returns array of shape as specified in shape_array with values = val.\n\n- ```linspace(start, end, num)``` - returns array of numbers in range [start, end] with length = num. Default num=50 unless specified.\n\n- ```mean(list)``` - returns mean of list elements.\n\n- ```min_max_normalize(list, callback)``` - returns array after applying Min-Max Normalization on list elements.\n\n- ```norm(list)``` - returns norm as in linear algebra for list elements.\n\n- ```shape(list, callback)``` - returns dimensions of input array if the array is uniform or error otherwise.\n\n- ```subtract(listA, listB, callback)``` - returns array of differences of corresponding elements of listA and listB of any dimensions.\n\n## Contribution\n\nHappy to recieve or provide contributions related to this package. Feel free to raise an issue if you find one. [Github Link](https://github.com/hrishibawane/npjs)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrishibawane%2Fnpjs-basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrishibawane%2Fnpjs-basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrishibawane%2Fnpjs-basic/lists"}