{"id":21316111,"url":"https://github.com/cjsaylor/baluster","last_synced_at":"2026-07-03T14:31:55.959Z","repository":{"id":138151505,"uuid":"190995836","full_name":"cjsaylor/baluster","owner":"cjsaylor","description":"Library to estimate baluster quantity and spacing for constructing railings.","archived":false,"fork":false,"pushed_at":"2019-06-16T15:34:53.000Z","size":328,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T10:36:31.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.chris-saylor.com/baluster/","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/cjsaylor.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":"2019-06-09T11:02:27.000Z","updated_at":"2019-06-26T13:41:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac75c981-fe34-4772-850a-2cb8934eb1d6","html_url":"https://github.com/cjsaylor/baluster","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/cjsaylor%2Fbaluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsaylor%2Fbaluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsaylor%2Fbaluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjsaylor%2Fbaluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjsaylor","download_url":"https://codeload.github.com/cjsaylor/baluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243791866,"owners_count":20348532,"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-21T18:29:46.132Z","updated_at":"2026-07-03T14:31:50.923Z","avatar_url":"https://github.com/cjsaylor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Baluster\n\nBaluster is a javascript library to enable estimation of balusters and calculating the spacing to get an even distribution on a constructed railing.\n\n\u003e Note: Please consult your local building codes for maximum spacing requirements. This library assumes maximum spacing distance of 4\".\n\n## Usage\n\n```\nnpm install baluster\n```\n\nFor babel/webpack apps:\n\n```js\nimport { estimateQuantity } from 'baluster'\n\nconsole.log(estimateQuantity(41.625))\n// 7\n```\n\nFor nodejs (commonjs) apps:\n\n```js\nconst { estimateQuantity } from 'baluster'\n\nconsole.log(estimateQuantity(41.625))\n// 7\n```\n\n## API\n\n### `estimateQuantity`\n\n```js\nint estimateQuantity(\n\tfloat widthBetweenPosts,\n\tfloat balusterWidth = 1.75\n)\n```\n\nGiven `widthBetweenPosts` which is the measurement in inches measured on the interior of the posts, this will calculate the number of balusters needed.\n\n---\n\n### `calculateSpacing`\n\n```js\nfloat calculateSpacing(\n\tfloat widthBetweenPosts,\n\tint balusterQuantity,\n\tfloat balusterWidth = 1.75\n)\n```\n\nCalculate the spacing that is needed between each baluster to make them all equidistant.\n\nThrows an exception if the `balusterQuantity` is not enough to satisfy maximum spacing requirements.\n\n---\n\n### spacingMeasurements\n\n```js\narray spacingMeasurements(\n\tfloat widthBetweenPosts,\n\tint balusterQuantity,\n\tfloat balusterWidth = 1.75\n)\n```\n\nAs with `calculateSpacing`, this will specify the measurements for each baluster on the rail (measurement centered on the baluster).\n\n---\n\n### nearest16th\n\n```js\nint nearest16th(\n\tfloat number\n)\n```\n\nUtility method to calculate the nearest 16th of an inch.\n\n```js\nconsole.log(nearest16th(0.5))\n// 8\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjsaylor%2Fbaluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjsaylor%2Fbaluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjsaylor%2Fbaluster/lists"}