{"id":22489196,"url":"https://github.com/adrian2x/atomic-fns","last_synced_at":"2025-08-02T21:32:16.564Z","repository":{"id":61435408,"uuid":"548693858","full_name":"adrian2x/atomic-fns","owner":"adrian2x","description":"Like Lodash, but for ESNext and with types.","archived":false,"fork":false,"pushed_at":"2023-01-27T17:48:55.000Z","size":421,"stargazers_count":17,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-08T02:12:06.155Z","etag":null,"topics":["esnext","javascript","modules","typescript","utilities"],"latest_commit_sha":null,"homepage":"https://atomic-stack.github.io/atomic-fns/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrian2x.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":null,"security":null,"support":null}},"created_at":"2022-10-10T03:16:44.000Z","updated_at":"2024-10-19T15:17:45.000Z","dependencies_parsed_at":"2023-02-15T11:31:17.612Z","dependency_job_id":null,"html_url":"https://github.com/adrian2x/atomic-fns","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrian2x%2Fatomic-fns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrian2x%2Fatomic-fns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrian2x%2Fatomic-fns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrian2x%2Fatomic-fns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrian2x","download_url":"https://codeload.github.com/adrian2x/atomic-fns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500221,"owners_count":17930020,"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":["esnext","javascript","modules","typescript","utilities"],"created_at":"2024-12-06T17:19:24.015Z","updated_at":"2025-08-02T21:32:16.551Z","avatar_url":"https://github.com/adrian2x.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# atomic-fns\n\n[Read the Docs](https://atomic-stack.github.io/atomic-fns/)\n\n## Like Lodash, but in TypeScript and for ESNext.\n\nStop shipping code built for browsers from 2015.\n\nYou may prefer this library because:\n\n* **TypeScript \u0026 docs**: Includes type declaration files and js with JSDocs for best in class experience.\n* **Zero deps**: Built from scratch with no runtime dependencies or polyfills.\n* **ESNext**: Uses modern idiomatic syntax, data structures, and control flow techniques.\n* **Modular**: Pick what you need. Supports tree-shaking, no side effects, and works with all bundlers.\n* **Lazy**: Leverage generators, iterators, and functional composition.\n* **Tests**: All modules have comprehensive test suites and 100% test coverage.\n\n## Docs\n\n📖 Available at [atomic-fns](https://atomic-stack.github.io/atomic-fns/)\n\n## Get Started\n\nThis library is available as an [npm package](https://www.npmjs.com/package/atomic-fns).\n\nTo install the package you need to have [npm](https://www.npmjs.com/get-npm) (or [yarn](https://yarnpkg.com/getting-started/install)) installed and then run:\n\n```bash\nnpm install atomic-fns\n```\n\n## How to use\n\nJust import any function or class you need.\n\n```js\nimport { sorted, times, uniqueId } from 'atomic-fns'\n\ntimes(5, (i) =\u003e i)\n// -\u003e [0, 1, 2, 3, 4]\n\nsorted([4, 3, 2, 1])\n// -\u003e [1, 2, 3, 4]\n\nuniqueId('user_')\n// -\u003e 'user_101225005'\n...\n```\n\nSee the full list of [modules](https://atomic-stack.github.io/atomic-fns/modules.html).\n\n## Data model\nThis library features a data model similar to [Python](https://docs.python.org/3/reference/datamodel.html#special-method-names) but not always. Only the missing parts have been implemented, while respecting the JS standards.\n\nFor example, in Python collections, `size()` is a method, while in JS it's just a property. So this library uses `size` property instead of method. Similarly, the `len` function implementation checks for both `length` and `size` since many JS objects have a `length` property.\n\n## Special method names\nThis library adds support for operators using object methods such as:\n  - `obj.eq(other)`  adds custom `obj == other`.\n  - `obj.lt(other)`  adds custom `obj \u003c other`.\n  - `obj.lte(other)`  adds custom `obj \u003c= other`.\n  - `obj.gt(other)`  adds custom `obj \u003e other`.\n  - `obj.gte(other)`  adds custom `obj \u003e= other`.\n  - `obj.compare(other)`  overloads sorting operations.\n\nWhen working with objects, functions in this library use these custom operators for equality and sorting. You can also apply operators to values like `eq(x, y)`, `lte(x, y)`, `compare(x, y)`, etc.\n\n## New Types\n\n[`Decimal`](https://atomic-stack.github.io/atomic-fns/classes/decimal.Decimal.html) provides support for correct rounded floating point arithmetic, with arbitrary precision.\n\nThis fixes precision issues with float arithmetic, for example:\n```\n0.1 + 0.1 + 0.1\n// 0.30000000000000004\n\ndecimal('0.1').add('0.1').add('0.1').toNumber()\n// 0.3\n```\n\nSome common base interfaces and typing patterns you may have seen like `Optional`, `Result`, `Comparable`, `Iterator`, and others.\n\n### Sorted Containers\n  - [SortedSet](https://atomic-stack.github.io/atomic-fns/classes/collections.SortedSet.html)\n  - [SortedMap](https://atomic-stack.github.io/atomic-fns/classes/collections.SortedMap.html)\n  - [SortedTree](https://atomic-stack.github.io/atomic-fns/classes/collections.SortedTree.html)\n\n### Other Containers\n  - [Deque](https://atomic-stack.github.io/atomic-fns/classes/collections.Deque.html)\n  - [FrozenSet](https://atomic-stack.github.io/atomic-fns/classes/collections.FrozenSet.html)\n  - [LRUCache](https://atomic-stack.github.io/atomic-fns/classes/collections.LRUCache.html)\n\n\n## Contributing\nIf you want to contribute to the project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request. You will be listed as a **Champion** on the official site as well.\n\n\n## License\n\n[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrian2x%2Fatomic-fns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrian2x%2Fatomic-fns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrian2x%2Fatomic-fns/lists"}