{"id":18249645,"url":"https://github.com/chandq/sculp-js","last_synced_at":"2026-03-14T10:02:23.444Z","repository":{"id":200141976,"uuid":"705213598","full_name":"chandq/sculp-js","owner":"chandq","description":"frontend js utils, achieve by ts, support esm、commonjs、umd","archived":false,"fork":false,"pushed_at":"2025-08-06T07:53:53.000Z","size":1317,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-06T09:34:08.895Z","etag":null,"topics":["commonjs","esm","js-utils","typescript","umd"],"latest_commit_sha":null,"homepage":"https://chandq.github.io/sculp-js/","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/chandq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-10-15T11:32:02.000Z","updated_at":"2025-07-19T22:10:33.000Z","dependencies_parsed_at":"2023-11-26T03:20:49.255Z","dependency_job_id":"2f0557a8-19a9-43f5-b0ac-5cb8e218a092","html_url":"https://github.com/chandq/sculp-js","commit_stats":null,"previous_names":["chandq/sculp-js"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/chandq/sculp-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandq%2Fsculp-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandq%2Fsculp-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandq%2Fsculp-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandq%2Fsculp-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chandq","download_url":"https://codeload.github.com/chandq/sculp-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandq%2Fsculp-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272248654,"owners_count":24899837,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["commonjs","esm","js-utils","typescript","umd"],"created_at":"2024-11-05T09:40:47.474Z","updated_at":"2026-03-14T10:02:23.437Z","avatar_url":"https://github.com/chandq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# sculp-js\n\n**A Modern JavaScript Utility Library for Web**\n\n[![Node.js CI](https://github.com/chandq/sculp-js/actions/workflows/node.js.yml/badge.svg)](https://github.com/chandq/sculp-js/actions/workflows/node.js.yml)\n[![sculp-js](https://img.shields.io/github/package-json/v/chandq/sculp-js?style=flat-square)](https://www.npmjs.com/package/sculp-js)\n[![license:MIT](https://img.shields.io/npm/l/vue.svg?sanitize=true)](https://github.com/chandq/sculp-js/blob/main/LICENSE.md)\n[![codecov](https://codecov.io/gh/chandq/sculp-js/graph/badge.svg?token=VZ6TERPGI9)](https://codecov.io/gh/chandq/sculp-js)\n\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003e A lightweight utility library written in TypeScript with zero dependencies, supporting ESM, CJS, and UMD formats.\n\n**[API Documentation](https://chandq.github.io/sculp-js/)** • **[Getting Started](#usage)** • **[Features](#features)**\n\n## ✨ Features\n\n- **Type-Safe**: Full TypeScript support with comprehensive type definitions\n- **Zero Dependencies**: Pure native implementation, no external libraries\n- **Tree Shaking**: Supports selective imports for smaller bundle sizes\n- **Multi-Format**: ESM, CJS, and UMD builds available\n- **Web Focused**: Optimized for modern web environments\n\n### Core Utilities\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eType Checking\u003c/strong\u003e\u003c/summary\u003e\n\n- `isString`, `isNumber`, `isBoolean`, `isFunction`, `isObject`, `isArray`\n- `isDate`, `isRegExp`, `isUndefined`, `isNull`, `isError`, `isNaN`\n- `isPrimitive`, `isSymbol`, `isBigInt`, `isPlainObject`\n- `isEmpty`, `isNodeList`, `isValidDate`, `typeIs`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eData Structures\u003c/strong\u003e\u003c/summary\u003e\n\n- **Array**: `arrayEach`, `arrayEachAsync`, `arrayInsertBefore`, `arrayRemove`\n- **Tree**: `forEachDeep`, `mapDeep`, `findDeep`, `filterDeep`, `searchTreeById`, `flatTree`, `fuzzySearchTree`\n- **Object**: `objectAssign`, `objectGet`, `objectHas`, `cloneDeep`, `objectPick`, `objectOmit`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eWeb APIs\u003c/strong\u003e\u003c/summary\u003e\n\n- **DOM**: `addClass`, `hasClass`, `removeClass`, `getStyle`, `setStyle`\n- **File**: `chooseLocalFile`, `compressImg`\n- **Clipboard**: `copyText`, `fallbackCopyText`\n- **Download**: `downloadBlob`, `downloadURL`, `downloadData`\n- **Watermark**: `genCanvasWM`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eEncoding \u0026 Validation\u003c/strong\u003e\u003c/summary\u003e\n\n- **Encode/Decode**: `weBtoa`, `weAtob`, `b64encode`, `b64decode`\n- **Validation**: `isEmail`, `isPhone`, `isUrl`, `isIDNO`, `isIPv4`, `isIPv6`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAdditional Utils\u003c/strong\u003e\u003c/summary\u003e\n\n- **Date**: `formatDate`, `calculateDate`, `dateToStart`, `dateToEnd`\n- **String**: `stringCamelCase`, `stringKebabCase`, `parseQueryParams`, `stringEscapeHTML`\n- **Math**: `add`, `subtract`, `multiply`, `divide`, `numberAbbr`\n- **Functional**: `debounce`, `throttle`, `once`, `wait`\n\n\u003c/details\u003e\n\n## 🚀 Installation\n\n### npm\n\n```bash\nnpm install sculp-js\n```\n\n### CDN\n\n```html\n\u003cscript src=\"https://unpkg.com/sculp-js\"\u003e\u003c/script\u003e\n```\n\n## 💡 Usage\n\n```js\nimport { forEachDeep, cloneDeep } from 'sculp-js';\n\n// Deep traversal of tree structures\nconst tree = [\n  {\n    id: 1,\n    name: 'Parent 1',\n    children: [\n      { id: 11, name: 'Child 1' },\n      { id: 12, name: 'Child 2', children: [{ id: 121, name: 'Grandchild 1' }] }\n    ]\n  },\n  { id: 2, name: 'Parent 2' }\n];\n\nconst names = [];\nforEachDeep(tree, item =\u003e {\n  names.push(item.name);\n});\n// names = ['Parent 1', 'Child 1', 'Child 2', 'Grandchild 1', 'Parent 2']\n\n// Deep cloning of objects\nconst original = { a: 1, b: { c: 2 } };\nconst cloned = cloneDeep(original);\n```\n\n## 📦 Module Formats\n\n```js\n// ES Modules (recommended)\nimport { cloneDeep } from 'sculp-js';\n\n// Individual module imports\nimport cloneDeep from 'sculp-js/cloneDeep';\n\n// CommonJS\nconst { cloneDeep } = require('sculp-js');\n```\n\n## 📄 License\n\nMIT License © 2023-present, [chandq](https://github.com/chandq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandq%2Fsculp-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchandq%2Fsculp-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandq%2Fsculp-js/lists"}