{"id":21407466,"url":"https://github.com/palashmon/generate-pi","last_synced_at":"2025-06-23T18:38:43.207Z","repository":{"id":57246160,"uuid":"96695828","full_name":"palashmon/generate-pi","owner":"palashmon","description":":package: Find PI(π) to the Nth Digit ","archived":false,"fork":false,"pushed_at":"2025-06-10T23:43:48.000Z","size":238,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-11T00:34:13.435Z","etag":null,"topics":["generate","library","micro-library","pi"],"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/palashmon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2017-07-09T16:11:21.000Z","updated_at":"2025-06-04T21:57:32.000Z","dependencies_parsed_at":"2024-02-26T05:28:15.917Z","dependency_job_id":"ee32e3a1-530d-40bc-8a0a-a08faf70bbf4","html_url":"https://github.com/palashmon/generate-pi","commit_stats":{"total_commits":134,"total_committers":4,"mean_commits":33.5,"dds":0.6417910447761195,"last_synced_commit":"05ff44bdd56335c873cfa3960ab108bb29ec7456"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/palashmon/generate-pi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fgenerate-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fgenerate-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fgenerate-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fgenerate-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palashmon","download_url":"https://codeload.github.com/palashmon/generate-pi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palashmon%2Fgenerate-pi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261534986,"owners_count":23173507,"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":["generate","library","micro-library","pi"],"created_at":"2024-11-22T16:52:44.260Z","updated_at":"2025-06-23T18:38:43.175Z","avatar_url":"https://github.com/palashmon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generate-pi\n\n\u003e Find PI(π) to the Nth Digit\n\n![CI](https://github.com/palashmon/generate-pi/actions/workflows/main.yml/badge.svg)\n[![npm version](https://img.shields.io/npm/v/generate-pi.svg)](http://npm.im/generate-pi)\n[![npm downloads](https://img.shields.io/npm/dm/generate-pi.svg)](http://npm.im/generate-pi)\n\n`generate-pi` provides a simple utility to find the value of Pi (π) up to the Nth decimal place. It offers both a default function to retrieve Pi with high precision and the flexibility to specify the number of decimal places required. The library uses the [Bailey–Borwein–Plouffe formula](https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula) to calculate Pi to the desired precision. It is lightweight and easy to use, making it a great choice for projects that require high-precision calculations of Pi.\n\n## Installation\n\n### Via Npm:\n\n```sh\nnpm install generate-pi\n```\n\n## Usage\n\n```javascript\nimport generatePi from 'generate-pi';\n\n// Find PI(π) to the 'n' decimal places\n// where n is any number between 0 and 200\nconst pi = generatePi.get(n);\n\n// Find PI(π) to the 10 decimal places\nconst pi10 = generatePi.get(10);\n// \"3.1415926535\"\n\n// Default to 200 decimal places\nconst pi200 = generatePi.get();\n```\n\n## API\n\n### generatePi.get(n)\n\nReturns the value of PI(π) to the 'n' decimal places.\n\n#### n\nType: `number`\u003cbr\u003e\nDefault: 200\n\nThe number of decimal places to return. It should be a number between 0 and 200.\n\n## Run Tests\n\n```\nnpm run test\n```\n\n## License\n\nMIT © [Palash Mondal](https://github.com/palashmon)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalashmon%2Fgenerate-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalashmon%2Fgenerate-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalashmon%2Fgenerate-pi/lists"}