{"id":17596171,"url":"https://github.com/birjuvachhani/screwdriver","last_synced_at":"2025-04-11T20:42:47.608Z","repository":{"id":46620735,"uuid":"287950867","full_name":"BirjuVachhani/screwdriver","owner":"BirjuVachhani","description":"A dart package aiming to provide useful extensions and helper functions to ease and speed up development.","archived":false,"fork":false,"pushed_at":"2025-04-09T05:24:38.000Z","size":5048,"stargazers_count":42,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T06:23:09.751Z","etag":null,"topics":["banner","dart","dart-library","dart-package","dart2","dartlang","ease","extension-methods","extension-pack","extensions","flutter","hacktoberfest","hacktoberfest-accepted","hacktoberfest2021","hactoberfest2022","helper","pubdev","screwdriver"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/screwdriver","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BirjuVachhani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-08-16T13:39:46.000Z","updated_at":"2025-04-09T05:24:19.000Z","dependencies_parsed_at":"2023-02-04T01:01:24.750Z","dependency_job_id":"4ac82575-f94f-414f-9b85-5f0d0a501da9","html_url":"https://github.com/BirjuVachhani/screwdriver","commit_stats":{"total_commits":403,"total_committers":2,"mean_commits":201.5,"dds":"0.14888337468982626","last_synced_commit":"d8b5ee991e4c87162eec7522b2552241a88b810e"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Fscrewdriver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Fscrewdriver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Fscrewdriver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BirjuVachhani%2Fscrewdriver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BirjuVachhani","download_url":"https://codeload.github.com/BirjuVachhani/screwdriver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248479483,"owners_count":21110897,"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":["banner","dart","dart-library","dart-package","dart2","dartlang","ease","extension-methods","extension-pack","extensions","flutter","hacktoberfest","hacktoberfest-accepted","hacktoberfest2021","hactoberfest2022","helper","pubdev","screwdriver"],"created_at":"2024-10-22T08:23:08.826Z","updated_at":"2025-04-11T20:42:47.593Z","avatar_url":"https://github.com/BirjuVachhani.png","language":"Dart","funding_links":["https://www.buymeacoffee.com/birjuvachhani"],"categories":[],"sub_categories":[],"readme":"![banner](https://github.com/BirjuVachhani/screwdriver/blob/main/.github/banner.png?raw=true)\n\n\n\n# Screwdriver\n\nA dart package aiming to provide useful extensions and helper functions to ease and speed up development.\n\n[![Tests](https://github.com/BirjuVachhani/screwdriver/workflows/Tests%20%26%20Coverage/badge.svg?branch=main)](https://github.com/BirjuVachhani/screwdriver/actions) [![Code Quality](https://github.com/BirjuVachhani/screwdriver/workflows/Code%20Quality/badge.svg?branch=main)](https://github.com/BirjuVachhani/screwdriver/actions) [![Codecov](https://img.shields.io/codecov/c/github/birjuvachhani/screwdriver.svg)](https://codecov.io/gh/birjuvachhani/screwdriver) ![Pub Version](https://img.shields.io/pub/v/screwdriver) [![Docs](https://img.shields.io/badge/Docs-dart%20docs-brightgreen)](https://pub.dev/documentation/screwdriver/latest/)\n\n\n- 📋  Well Documented\n- ⚔️ Fully Tested\n- 👌 Follows Code Quality Guidelines\n- 🦾 Production Ready\n- [collection](https://pub.dev/packages/collection) included for extra extensions.\n\n## Stats\nCheck out [EXTENSIONS.md](EXTENSIONS.md) for a complete list of all the available extensions.\n\u003c!---stats_start--\u003e\n```yaml  \nExtensions:                    293\nExtension Types:               4\nHelper Classes:                5\nHelper Functions \u0026 Getters:    26\nTypedefs:                      8\nMixins:                        2\n```\n\n\u003e *Last Updated: Wed, Apr 09, 2025 - 05:18 AM*\n\n\u003c!---stats_end--\u003e\n\n*Stats auto generated using [Github Workflow](https://github.com/BirjuVachhani/screwdriver/blob/main/.github/workflows/stats.yaml).*\n\n\n\u003cbr/\u003e\n\nTo checkout all the available extensions, helper functions \u0026 classes, see [documentation][docs].\n\n\n## Installation\n\n1. Add as a dependency in your project's `pub spec.yaml`.\n\n```yaml\ndependencies:\n  screwdriver: \u003clatest_version\u003e\n```\n\n\u003e Note: Screwdriver exports `collection` package as well. So, you don't need to add `collection` as a dependency in your project.\n\n2. Import library into your code.\n\n```dart\nimport 'package:screwdriver/screwdriver.dart';\n```\n\n3. Use this import for using IO extensions.\n\n```dart\nimport 'package:screwdriver/screwdriver_io.dart';\n```\n\n\n\nA Glimpse of Screwdriver\n\n#### String\n\n```dart\n'hello'.capitalized; // Hello\n'   '.isBlankl // true;\n'45'.toIntOrNull(); // 45\n'html'.wrap('\u003c','\u003e'); // \u003chtml\u003e\n'1010111010001'.isBinary; // true\n'test@example.com'.isEmail; // true\n'abcd'.reversed; // dcba\n'This is a test'.words; // ['this', 'is', 'a', 'test']\n'{\"name\":\"John\"}'.parseJson(); // map: {name:John}\n'#hello'.removePrefix('#'); // hello\n```\n\n#### Map\n\n```dart\nfinal Map\u003cString, dynamic\u003e map = {\n  'name': 'John',\n  'age': 24,\n};\n\nfor(final (key, value) in map.records) {\n  print('$key: $value');\n}\n```\n\n#### Int\n\n```dart\n20.isDivisibleBy(5); // true\n0.asBool; // false\n6.twoDigits; // '06'\n2020.isLeapYear; // true\n10.repeat((count) =\u003e print(count));\n```\n\n\n\n#### DateTime \u0026 Duration\n\n```dart\nnow().isMonday;\nfinal DateTime fiveDaysAgo = 5.daysAgo;\nfinal Duration nineMinutes = 9.minutes;\n45.minutes.isInHours; // false\n15.daysAgo \u003c 5.days.ago; // true\n20.minutes.ago \u003e= 50.minutes.ago; // true\nnow().previousDay; // yesterday\n10.days.ago.isBetween(15.days.ago, now()); // true\n```\n\n\n\n#### Double and Bool\n\n```dart\nrandomDouble(max: 50); // random double value between 0 and 50\n56.0.isWhole; // true\ntrue.toggled; // false\nfalse.toInt(); // 0\n\n```\n\n\n\n#### Scope Functions\n\n```dart\nfinal User user = User(name: 'John').apply((user){\n  user.age = 24;\n  user.email = 'john@doe.com';\n});\nfinal String age = user.run((u)=\u003e (u.age + 20).toString());\n```\n\n\n\n#### Collections\n\n```dart\nusers \u003c\u003c User(name: 'John'); // appends user to users list\nusers.firstOrNull;\nusers.drop(5);\nusers.takeLast(3);\nuser.all((u) =\u003e u.age \u003e 18); // returns bool\ncars.groupBy((car) =\u003e car.color);\ncars.count((car) =\u003e car.isPorsche);\ncars.random();\ncars.maxBy((car) =\u003e car.price);\ncars.intersect(otherCars);\n{'name': 'John'} \u003c\u003c Pair('email','john@doe.com');\n```\n\n\n\n#### Future\n\n```dart\npostDelayed(2000,(){\n  print('after 2 seconds');\n});\n```\n\n\n\n#### IO\n\n```dart\nfile.onModified(() =\u003e print('file modified'));\nfile.clear(); // flushes all the data of file\nfile.isEmpty;\nfile.appendString('hello');\nfile \u003c\u003c 'some text';\nfile1 + file2; // appends file2 content at the end of file1\n```\n\n\n\n#### Some More\n\n```dart\ncheck(divider != 0);\nrunCaching((){\n  count / 0;\n});\nTODO('find a way to implement this properly'); // throws UnimplementedError on invocation\nTriple(45,true, 'Hello World');\nuser.takeIf((u) =\u003e u.age \u003e 18)?.allowAccess();\nperson.takeUnless((p) =\u003e p \u003e 18)?.areTeenagers();\nfinal DateTime date = tomorrow;\nyesterday.isInDecember;\n```\n\n\n\nCheck out [EXTENSIONS.md](EXTENSIONS.md) for a complete list of all the available extensions.\n\nCheckout [documentation][docs] for more details.\n\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/BirjuVachhani/screwdriver/issues\n[docs]: https://pub.dev/documentation/screwdriver/latest/\n\n\n\n#### Liked Screwdriver?\n\nShow some love and support by starring the [repository](https://github.com/birjuvachhani/screwdriver).\n\nOr You can\n\n\u003ca href=\"https://www.buymeacoffee.com/birjuvachhani\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-blue.png\" alt=\"Buy Me A Coffee\" style=\"height: 51px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n\n\n## License\n\n```\nCopyright (c) 2020, Birju Vachhani\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirjuvachhani%2Fscrewdriver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirjuvachhani%2Fscrewdriver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirjuvachhani%2Fscrewdriver/lists"}