{"id":18746894,"url":"https://github.com/iainjreid/stark","last_synced_at":"2025-11-24T01:30:15.417Z","repository":{"id":39405967,"uuid":"262833455","full_name":"iainjreid/stark","owner":"iainjreid","description":"Minimal and incredibly lightweight functional programming for JavaScript","archived":false,"fork":false,"pushed_at":"2023-01-06T05:37:04.000Z","size":384,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T20:46:18.652Z","etag":null,"topics":["functional","functional-programing","javascript","utilities","utilities-library"],"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/iainjreid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-05-10T16:54:21.000Z","updated_at":"2024-08-07T20:00:17.000Z","dependencies_parsed_at":"2023-02-05T10:45:33.034Z","dependency_job_id":null,"html_url":"https://github.com/iainjreid/stark","commit_stats":null,"previous_names":["emphori/stark"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iainjreid%2Fstark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iainjreid%2Fstark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iainjreid%2Fstark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iainjreid%2Fstark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iainjreid","download_url":"https://codeload.github.com/iainjreid/stark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239629856,"owners_count":19671366,"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":["functional","functional-programing","javascript","utilities","utilities-library"],"created_at":"2024-11-07T16:27:28.835Z","updated_at":"2025-11-24T01:30:15.354Z","avatar_url":"https://github.com/iainjreid.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stark\n\n## Introduction\n\nStark is a simple library that turns the JavaScript built-in objects into\nindividual suites of composable, functional methods. It's tiny (around 1KB) and\nunopinionated.\n\nIt works by flipping the methods exposed through the prototypes of every\nbuilt-in object, so that they expect the subject of the operation to appear at\nthe _end_ of the arguments list. Here's a working comparison...\n\n```javascript\nconst arr = ['hello', 'world']\n\n# Plain JavaScript\narr.join(' ') //  =\u003e \"hello world\"\n\n# With Stark\njoin(' ', arr) // =\u003e \"hello world\"\n```\n\nYou can think of Stark as a sort of packet mix, providing the core ingredients\nrequired to build a fully-fledged functional programming library.\n\n## Features\n\n* Built-in currying and partial application.\n* Not a single variadic function in sight.\n* Argument flipping out of the box.\n\n## Using Stark\n\nTo use Stark in your project you should first install it as a dependency.\n\n```bash\n# For NPM users\nnpm i @emphori/stark\n\n# Or, for Yarn users\nyarn add @emphori/stark\n```\n\n### Unpacking the library\n\nStark organises its methods according to the type of data that they operate on,\nfor example, the `map` method can be found at `S.Array.map`, the `startsWith`\nmethod can be found at `S.String.startsWith`, etc.\n\nWhilst the simplest way to get started would be to reference each method using\ntheir full lookup paths like in the examples above, unpacking the methods you\nneed before using them is a useful trick.\n\n```javascript\nconst stark = require('@emphori/stark')\n\nconst {\n  Array: { map },\n  String: { startsWith },\n} = stark\n```\n\n## FAQ\n\n### Why should I avoid unpacking Stark when requiring it?\n\nStark is a dynamically built library from the ground up and doesn't declare any\nnamed exports, only a default export. So to answer this question is to relay a\nkey distinction between [ESM imports][2] and [object destructuring][2].\n\n```javascript\n// ✔️ CommonJS (works)\nconst { Array: { map } } = require('@emphori/stark')\n\n// ❌ ESM imports (doesn't work)\nimport { Array: { map } } from '@emphori/stark'\n```\n\n[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export\n[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment\n\nAs you can see in the example above, CommonJS introps nicely with the\nstructuring of Stark's internals, but ESM imports sadly do not.\n\n## License\n\nThis project is released under the [MIT License](./LICENSE). Enjoy responsibly ✌️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiainjreid%2Fstark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiainjreid%2Fstark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiainjreid%2Fstark/lists"}