{"id":21525863,"url":"https://github.com/bkwld/katamari","last_synced_at":"2025-03-17T18:20:07.620Z","repository":{"id":9151322,"uuid":"10945059","full_name":"BKWLD/katamari","owner":"BKWLD","description":"Convert distances into terms that are more easily visualized","archived":false,"fork":false,"pushed_at":"2023-09-11T16:44:01.000Z","size":839,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-05T10:02:04.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bkwld.github.io/katamari/","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/BKWLD.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":"2013-06-25T17:27:09.000Z","updated_at":"2023-09-11T16:35:35.000Z","dependencies_parsed_at":"2025-01-24T05:29:08.053Z","dependency_job_id":"69f5dff1-b810-43ea-bb0d-5c88fb362b3e","html_url":"https://github.com/BKWLD/katamari","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/BKWLD%2Fkatamari","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fkatamari/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fkatamari/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fkatamari/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BKWLD","download_url":"https://codeload.github.com/BKWLD/katamari/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085009,"owners_count":20395523,"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":"2024-11-24T01:38:44.560Z","updated_at":"2025-03-17T18:20:07.602Z","avatar_url":"https://github.com/BKWLD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Katamari.js\n\nBeing told something is 300 feet away or 50 meters or 2.4 miles can be tough to visualize.  Katamari turns distances into multiples of objects that ARE easy to visualize.  You can use it to convert one unit to another:\n\n\tkatamari('1 meter', 'bicycles'); // \"0.6 bicycles\"\n\nOr you can let it choose an appropriate unit of measurement for you:\n\n\tkatamari('1 meter'); // \"7.8 garden gnomes\"\n\t\nYou can pass a hash of options to tweak the output:\n\n\tkatamari('0.02km', 'default', {precision: 3, output: 'object'}); // {value: 2.857, unit: \"elephant\", pluralled: \"elephants\"}\n\nDemo site: http://bkwld.github.io/katamari/\n\n## Installation [![Build Status](https://travis-ci.org/BKWLD/katamari.png?branch=master)](https://travis-ci.org/BKWLD/katamari)\n\nGrab [dist/katamari.js](https://raw.github.com/BKWLD/katamari/master/dist/katamari.js) or [dist/katamari.min.js](https://raw.github.com/BKWLD/katamari/master/dist/katamari.min.js) from the repo.\n\n#### Require.js, Node.js (AMD, CJS)\n\n\tvar katamari = require('path/to/katamari.js');\n\tconsole.log(katamari('1 meter'));\n\t\n#### In browser\n\n\t\u003cscript type=\"text/javascript\" src=\"path/to/katamari.min.js\"\u003e\u003c/script\u003e\n\t\u003cscript\u003econsole.log(katamari('1 meter'));\u003c/script\u003e\n\n## Usage\n\n#### katamari ( *mixed* input [, *string* format] [, *object* options]])\n\n* input - The input distance. If a float, it is treated as meters.  Otherwise, pass it a string using any of the units that Katamari supports.  Ex: \"5.2 garden gnomes\" or \"1 dragon\".  Both plural and non plural forms are accepted.* \n* format - The output format. If blank, uses the \"default\" scale (which auto selects an appropriate unit).  Otherwise, you can use any Katamari unit.* \n* options - A hash that allows any of the following pairs:\n\t* precision - Specify how many decimals to round to, defaults to 1.\n\t* output - How to return the converted input.  The default is \"string\" which returns a response like `14.2 meters`.  Set to \"number\" to return just the value (ex: `14.2`); this wouldn't make sense if you set the format to a scale.  Or, set to \"object\" to return a hash that looks like `{value:14.2, unit:'meter', pluralled:'meters'}`.\n\n*Supported units*\n\n* meter\n* kilometer\n* mile\n* garden gnome\n* bicycle\n* elephant\n* school bus\n* dragon\n* roman colosseum\n* starship enterprise\n* golden gate bridge\n\nAnd you can also use the following as scales:\n\n* default\n\n## Contribute\n\nI encourage folks to submit new units (or whatever) via pull request.  Make sure to run the unit tests or add to them as appropriate.  To run the tests and build the dist version of Katamari:\n\n1. Install npm and run `npm install`\n2. Install [grunt globally](http://gruntjs.com/getting-started#installing-the-cli)\n3. Run `grunt test` from the repo directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkwld%2Fkatamari","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkwld%2Fkatamari","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkwld%2Fkatamari/lists"}