{"id":24206358,"url":"https://github.com/open-tech-foundation/js-std","last_synced_at":"2026-04-26T23:03:15.200Z","repository":{"id":57133398,"uuid":"384390624","full_name":"Open-Tech-Foundation/js-std","owner":"Open-Tech-Foundation","description":"An Extensive  JavaScript Standard Library.","archived":false,"fork":false,"pushed_at":"2024-07-08T19:43:32.000Z","size":4141,"stargazers_count":11,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T19:26:13.345Z","etag":null,"topics":["browser","bun","deno","javascript","library","nodejs","standard","stdlib","typescript"],"latest_commit_sha":null,"homepage":"https://js-std.pages.dev/","language":"TypeScript","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/Open-Tech-Foundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Open-Tech-Foundation"]}},"created_at":"2021-07-09T09:40:06.000Z","updated_at":"2024-09-28T14:55:14.000Z","dependencies_parsed_at":"2024-01-12T04:57:03.703Z","dependency_job_id":"3fbe523d-e0d6-42af-b91b-4224c51c759f","html_url":"https://github.com/Open-Tech-Foundation/js-std","commit_stats":{"total_commits":152,"total_committers":3,"mean_commits":"50.666666666666664","dds":0.1578947368421053,"last_synced_commit":"a7abe61ac94f58c7e5ca67fa5c462a1345508117"},"previous_names":["open-tech-world/js-utils","open-tech-world/es-utils","open-tech-foundation/js-std","open-tech-foundation/js-utils"],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/Open-Tech-Foundation/js-std","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Fjs-std","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Fjs-std/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Fjs-std/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Fjs-std/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Open-Tech-Foundation","download_url":"https://codeload.github.com/Open-Tech-Foundation/js-std/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Fjs-std/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30076935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["browser","bun","deno","javascript","library","nodejs","standard","stdlib","typescript"],"created_at":"2025-01-14T00:20:16.415Z","updated_at":"2026-04-26T23:03:15.193Z","avatar_url":"https://github.com/Open-Tech-Foundation.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\n# @opentf/std\n\n**The Modern JavaScript Standard Library.**\n*A lightweight, high-accuracy, and cross-runtime collection of essential utilities.*\n\n[![Build Status](https://github.com/open-tech-foundation/js-std/actions/workflows/build.yml/badge.svg)](https://github.com/open-tech-foundation/js-std/actions/workflows/ci.yml)\n[![JSR Score](https://jsr.io/badges/@opentf/std/score)](https://jsr.io/@opentf/std)\n\n*Part of the \u003cimg src=\"https://open-tech-foundation.pages.dev/img/Logo.svg\" width=\"18\" height=\"18\" style=\"vertical-align: middle;\" /\u003e [Open Tech Foundation](https://github.com/Open-Tech-Foundation) ecosystem.*\n\n[**Live Demo**](https://js-std.pages.dev/playground) | [**Documentation**](https://js-std.pages.dev) | [**Report Bug**](https://github.com/open-tech-foundation/js-std/issues)\n\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n- 🎨 **Intuitive API**: Designed for clarity, simplicity, and ease of use.\n- 🌍 **Runtime Agnostic**: Seamless execution across all JavaScript environments.\n- ⚡ **High Performance**: Optimized for speed without sacrificing accuracy.\n- ⏳ **Modern Async**: Advanced tools for managing complex asynchronous flows.\n- 🛡️ **Full Type Safety**: Built with TypeScript for deep, native type inference.\n- 📦 **Zero Dependencies**: Lightweight, tree-shakeable, and ESM/CJS ready.\n- 🌲 **Broad Compatibility**: Future-proof code with broad environment support.\n\n## 🌍 Environment Support\n\n| Environment | Supported Versions | Note |\n| :--- | :--- | :--- |\n| **Node.js** | **\u003e= 18.0.0** | **Polyfill required for Node 18** |\n| **Browsers** | All modern browsers | Native |\n| **Bun** | \u003e= 1.0.0 | Native |\n| **Deno** | \u003e= 1.0.0 | Native |\n\n### 🛠️ Node.js 18 Support\n\nTo use features like `uuid` or `randomBytes` in Node.js 18, you must manually polyfill the `webcrypto` API:\n\n```js\nimport crypto from 'node:crypto';\n\nif (typeof globalThis.crypto === 'undefined') {\n  Object.defineProperty(globalThis, 'crypto', {\n    value: crypto.webcrypto,\n    writable: true,\n    configurable: true,\n  });\n}\n```\n\n## 📦 Installation\n\nInstall `@opentf/std` using your preferred package manager:\n\n```sh\n# Bun\nbun add @opentf/std\n\n# pnpm\npnpm add @opentf/std\n\n# npm\nnpm install @opentf/std\n\n# Deno\ndeno add @opentf/std\n```\n\n## 🛠 Usage\n\nExplore the library's capabilities with these examples:\n\n### 1. Checking if a Value is Numeric\n```js\nimport { isNumber } from \"@opentf/std\";\n\nisNumber(NaN); //=\u003e false\nisNumber('1'); //=\u003e false\nisNumber('1', true); //=\u003e true\nisNumber(1); //=\u003e true\n```\n\n### 2. Converting Strings to Pascal Case\n```js\nimport { pascalCase } from \"@opentf/std\";\n\npascalCase(\"pascal case\"); //=\u003e PascalCase\n```\n\n### 3. Sorting an Array in Descending Order\n```js\nimport { sort } from \"@opentf/std\";\n\nsort([1, 10, 21, 2], \"desc\"); //=\u003e [21, 10, 2, 1]\n```\n\n### 4. Deep Cloning an Object\n```js\nimport { clone } from \"@opentf/std\";\n\nconst obj = { a: 1, b: \"abc\", c: new Map([[\"key\", \"val\"]]) };\nclone(obj); // Returns deeply cloned value\n```\n\n### 5. Smart Equality\n```js\nimport { isEql, isUnorderedEqual } from \"@opentf/std\";\n\nisEql({a: 1}, {a: 1}); //=\u003e true\n\nconst mapA = new Map([[\"a\", 1], [\"b\", 2]]);\nconst mapB = new Map([[\"b\", 2], [\"a\", 1]]);\nisEql(mapA, mapB); //=\u003e false\n\n// Compare Arrays ignoring order\nisUnorderedEqual([1, 2, 3], [2, 3, 1]); //=\u003e true\n```\n\n### 6. Unified Color Conversion\n```js\nimport { color, ColorFormat } from \"@opentf/std\";\n\ncolor(\"orange\", ColorFormat.HEX); //=\u003e \"#ffa500\"\ncolor(\"#00ffff\", \"rgba\"); //=\u003e \"rgba(0, 255, 255, 1)\"\n```\n\n## 📖 API\n\n- 📁 [**Local API Docs**](./packages/std/docs/README.md) - View the API reference directly in the repository.\n- 🌐 [**Documentation Website**](https://js-std.pages.dev) - Searchable online version with examples and a live playground.\n\n---\n\n## 📊 Benchmarks\n\nWe prioritize **reliability and accuracy** over extreme performance, while maintaining highly competitive speeds.\n\n### `clone`\n| Library | ops/sec | Average Time | Notes |\n| :--- | :--- | :--- | :--- |\n| **@opentf/std (clone)** | **466,736** | **~2.1μs** | **Full accuracy, supports all modern types.** |\n| copy (fast-copy) | 434,805 | ~2.3μs | Missing some modern features. |\n| cloneDeep (clone-deep) | 397,935 | ~2.5μs | No circular ref support. |\n| structuredClone (Native) | 228,477 | ~4.4μs | Built-in native support. |\n| _.cloneDeep (Lodash) | 161,017 | ~6.2μs | Lacks some modern features. |\n\n### `sortBy`\n| Library | ops/sec | Average Time |\n| :--- | :--- | :--- |\n| **@opentf/std (sortBy)** | **2,656,536** | **~376ns** |\n| sort (Moderndash) | 2,799,559 | ~357ns |\n| R2.sortBy (Remeda) | 1,604,434 | ~623ns |\n| _.orderBy (Lodash) | 1,263,727 | ~791ns |\n| R.sortWith (Ramda) | 1,066,487 | ~937ns |\n\n### `isEql`\n| Library | ops/sec | Average Time | Notes |\n| :--- | :--- | :--- | :--- |\n| **@opentf/std (isEql)** | **75,675** | **~13.2μs** | **Full accuracy, Map/Set ordering, Symbols.** |\n| deepStrictEqual (Native) | 717,658 | ~1.4μs | Limited features, no browser support. |\n| fastDeepEqual | 586,098 | ~1.7μs | Missing many modern features. |\n| dequal | 375,797 | ~2.6μs | No cyclic refs or Map ordering. |\n| _.isEqual (Lodash) | 137,667 | ~7.2μs | Missing Map/Set accuracy. |\n\n\u003e [!TIP]\n\u003e Run your own benchmarks: `bun run build \u0026\u0026 bun benchmark.js`\n\n---\n\n## 📖 Articles\n\n- [Introducing Our New JavaScript Standard Library](https://ganapathy.hashnode.dev/introducing-our-new-javascript-standard-library)\n- [You Don't Need JavaScript Native Methods](https://ganapathy.hashnode.dev/you-dont-need-javascript-native-methods)\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](./LICENSE).\n","funding_links":["https://github.com/sponsors/Open-Tech-Foundation"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-tech-foundation%2Fjs-std","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-tech-foundation%2Fjs-std","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-tech-foundation%2Fjs-std/lists"}