{"id":29702479,"url":"https://github.com/devgateway/nice-buckets","last_synced_at":"2025-07-23T12:39:27.821Z","repository":{"id":19490900,"uuid":"22736923","full_name":"devgateway/nice-buckets","owner":"devgateway","description":"get human-friendly ranges","archived":false,"fork":false,"pushed_at":"2014-11-13T20:04:55.000Z","size":187,"stargazers_count":0,"open_issues_count":5,"forks_count":1,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-07-11T21:32:41.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/devgateway.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}},"created_at":"2014-08-07T21:21:45.000Z","updated_at":"2014-11-13T19:29:59.000Z","dependencies_parsed_at":"2022-09-14T13:41:24.289Z","dependency_job_id":null,"html_url":"https://github.com/devgateway/nice-buckets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devgateway/nice-buckets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fnice-buckets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fnice-buckets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fnice-buckets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fnice-buckets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgateway","download_url":"https://codeload.github.com/devgateway/nice-buckets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fnice-buckets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266680647,"owners_count":23967794,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2025-07-23T12:39:26.026Z","updated_at":"2025-07-23T12:39:27.804Z","avatar_url":"https://github.com/devgateway.png","language":"CoffeeScript","readme":"Nice Buckets!\n=============\n\n[![Build Status](https://travis-ci.org/devgateway/nice-buckets.svg?branch=master)](https://travis-ci.org/devgateway/nice-buckets)\n\nget human-friendly ranges\n\n\nInstall\n-------\n\n```bash\n$ npm install nice-buckets\n```\n\n\nUsage\n-----\n\n```javascript\nvar niceBuckets = require('nice-buckets');\n\nvar buckets = 4,\n    range: [3321.723, 78052.536];\n\nconsole.log(buckets.minFigs(buckets, range));\n```\n\nyeilds the pleasing intervals:\n\n```json\n[ [ 0, 20000 ],\n  [ 20000, 40000 ],\n  [ 40000, 60000 ],\n  [ 60000, 80000 ] ]\n```\n\nNote that the number of buckets returned may, in some cases, be fewer than those requested.\n\n```nodejs\n\u003e require('nice-buckets').minFigs(2, [0, 0]);  // can't really create more than one bucket for a range span of 0....\n[ [ 0, 0 ] ]\n```\n\n\nVersions\n--------\n\nThis module is experimental -- it may start following semver later, but for now, every new version may break the api and the behavior.\n\n\n...\n---\n\nThe structure of this repo and some generic parts of the code are heavily inspired by boronine's [husl](https://github.com/boronine/husl).\n\n\nLicense\n-------\n\nCopyright (C) 2014 Development Gateway\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgateway%2Fnice-buckets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgateway%2Fnice-buckets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgateway%2Fnice-buckets/lists"}