{"id":25300146,"url":"https://github.com/deftio/jado","last_synced_at":"2025-04-06T23:40:41.738Z","repository":{"id":49600560,"uuid":"197882430","full_name":"deftio/jado","owner":"deftio","description":"JADO is a javascript mini library which treats any object as an interable. Also includes a stats object for counting freq/avg/med/modes on lists.","archived":false,"fork":false,"pushed_at":"2023-07-19T00:45:51.000Z","size":894,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-13T05:38:31.186Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deftio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-20T05:03:48.000Z","updated_at":"2023-02-20T11:29:24.000Z","dependencies_parsed_at":"2023-01-22T14:45:51.674Z","dependency_job_id":null,"html_url":"https://github.com/deftio/jado","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Fjado","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Fjado/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Fjado/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deftio%2Fjado/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deftio","download_url":"https://codeload.github.com/deftio/jado/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569130,"owners_count":20959758,"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-13T05:38:33.870Z","updated_at":"2025-04-06T23:40:41.721Z","avatar_url":"https://github.com/deftio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-BSD%202--Clause-blue.svg)](https://opensource.org/licenses/BSD-2-Clause)\r\n[![NPM version](https://img.shields.io/npm/v/jado.svg?style=flat-square)](https://www.npmjs.com/package/jado)\r\n[![Build Status](https://travis-ci.org/deftio/jado.svg?branch=master)](https://travis-ci.org/deftio/jado)\r\n\r\n\r\n# jado - a javascript data objects library\r\n \r\nJado is a small library for treating any javascript objects as iterables.  This allows generic (iterated) operations to be applied to any object type blindly which is useful some code and testing operations where the type is not known beforehand and some items may be singletons.\r\n\r\nNote that many libraries (underscore etc) provide some measure of this on objects and have higher peformance for those ops.  Also the Javascript Iterable was introduced after this library was written.\r\n\r\nTest and build packages updated for simple release.\r\n\r\nProvided as UMD \r\n\r\n\r\n## Features\r\n\r\n* works in both server side (node_js and browser) and provided in both source and minified forms\r\n* no dependancies on any other libraries\r\n* OSI approved open-source.  \r\n\r\n## Installation (server side)\r\nnpm install jado --save \r\n\r\n## Usage\r\njado can be used in a browser or nodejs (server) and has no dependancies.   \r\n\r\n### Browser: Including jado in the browser:\r\nIn a browser just include script tags:\r\n\r\n```html\r\n\u003cscript type=\"text/javascript\" src=\"./jado.min.js\"\u003e\u003c/script\u003e\r\n```\r\nor via CDN\r\n```html\r\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/jado/jado.min.js\"\u003e\u003c/script\u003e\r\n```\r\n\r\n### In nodejs \r\n```javascript\r\nvar jado = require('./jado.js');  //adds to current scope\r\n```\r\n\r\n### Simple Code Example (same usage in either browser or nodejs)\r\n```javascript\r\n\r\n//this works like an array.map\r\njado.map([23,25],function(x){return x+1}) // returns [24, 26]\r\n\r\n//this works the same way, note that the result is also a singleton\r\njado.map(23,function(x){return x+1})  // returns 24 \r\n\r\n\r\n\r\n//==================================\r\n// jado also includes a stats object for counting keys and values called jado.cset:\r\n// using the counting set jado.cset()\r\nx = jado.cset()\r\nx.add(2);  //add the key 2  ===\u003e key 2 , count: 1\r\nx.add(3);  //add the key 3  ===\u003e key 3 , count: 1\r\nx.add(3);  // key 3 ==\u003e, count: 2\r\nx.keys();  // returns [2,3]\r\nx.add(4);  // returns [2,3,4]\r\nx.add(7);  // returns [2,3,4,7]\r\n\r\n//stats on the counts of the keys\r\nx.avg();   // returns 1.25   // avg of the counts on the keys\r\nx.std();   // returns 0.433  // std dev of the counts \r\nx.vari();  // returns 0.1875\r\n\r\n\r\n```\r\n\r\nMore examples in the examples folder (TBD)\r\nThe project works but I moved on to other things.  Build just updated for NPM.\r\n\r\n# Source code home\r\nall source is at github:\r\nhttp://github.com/deftio/jado\r\n\r\nWeb url and examples\r\nhttp://deftio.com/jado\r\n\r\n\r\n## Linting \r\njado uses eslint for static code checking and analysis.\r\n\r\n```bash\r\nnpm install eslint --save-dev\r\n./node_modules/.bin/eslint --init\r\n\r\n```\r\n\r\nNow run the lint test like this:\r\n```bash\r\nnpm run lint \r\n```\r\n\r\n## Tests  (requires mocha and chai test suites)  \r\njado is tested with the mocha framework installed locally using npm\r\n\r\n```bash\r\nnpm install mocha --save-dev mocha\r\n\r\n```\r\n\r\nRun the tests as follows:\r\n```bash\r\nnpm run test \r\n\r\n```\r\n\r\n\r\n## Release History\r\n* 1.0.x Initial release\r\n\r\n## License\r\n\r\n(OSI Approved BSD 2-clause)\r\n\r\nCopyright (c) 2011-2016, M. A. Chatterjee \u003cdeftio at deftio dot com\u003e\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without\r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, this\r\n  list of conditions and the following disclaimer.\r\n\r\n* Redistributions in binary form must reproduce the above copyright notice,\r\n  this list of conditions and the following disclaimer in the documentation\r\n  and/or other materials provided with the distribution.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeftio%2Fjado","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeftio%2Fjado","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeftio%2Fjado/lists"}