{"id":26606996,"url":"https://github.com/grossacasac/utilsac","last_synced_at":"2025-04-09T20:43:27.748Z","repository":{"id":55577237,"uuid":"106960652","full_name":"GrosSacASac/utilsac","owner":"GrosSacASac","description":"Utility functions","archived":false,"fork":false,"pushed_at":"2025-01-28T17:21:12.000Z","size":965,"stargazers_count":16,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T06:01:35.380Z","etag":null,"topics":["deep-copy","hacktoberfest","javascript","utility"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrosSacASac.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license.txt","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}},"created_at":"2017-10-14T20:30:23.000Z","updated_at":"2025-03-29T20:44:00.000Z","dependencies_parsed_at":"2023-10-15T03:17:33.584Z","dependency_job_id":"db864921-90bb-4b44-81d0-ba819e89f8b6","html_url":"https://github.com/GrosSacASac/utilsac","commit_stats":{"total_commits":230,"total_committers":13,"mean_commits":"17.692307692307693","dds":"0.28260869565217395","last_synced_commit":"ccfe69091ed3b785b2c5792508d4387b085c2c63"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrosSacASac%2Futilsac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrosSacASac%2Futilsac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrosSacASac%2Futilsac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrosSacASac%2Futilsac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrosSacASac","download_url":"https://codeload.github.com/GrosSacASac/utilsac/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248110476,"owners_count":21049492,"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":["deep-copy","hacktoberfest","javascript","utility"],"created_at":"2025-03-23T22:35:30.235Z","updated_at":"2025-04-09T20:43:27.728Z","avatar_url":"https://github.com/GrosSacASac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [utilsac](https://github.com/GrosSacASac/utilsac)\n\nUtility functions\n\n## Installation\n\n[`npm i utilsac`](https://www.npmjs.com/package/utilsac)\n\n## Usage\n\nThe source code is the documentation.\n\n## utility.js\n\n```js\nimport {\n    createDebounced,\n    createThrottled,\n    throttledWithLast,\n    chainPromiseNTimes,\n    chainPromises,\n    forceThrottlePromiseCreator,\n    throttlePromiseCreator,\n    throttlePromiseCreatorSelfClean,\n    somePromisesParallel,\n    chainRequestAnimationFrame,\n    decorateForceSequential,\n    doNTimes,\n    timeFunction,\n    timePromise,\n    memoizeAsStrings,\n    createTemplateTag,\n    bytesLengthFromString,\n    assignSelected,\n} from \"utilsac\";\n\n// deno\nimport {\n    createDebounced,\n    createThrottled,\n    throttledWithLast,\n    chainPromises,\n    somePromisesParallel,\n    chainRequestAnimationFrame,\n    doNTimes,\n    chainPromiseNTimes,\n    timeFunction,\n    timePromise,\n    memoizeAsStrings,\n    createTemplateTag,\n    bytesLengthFromString,\n} from \"https://unpkg.com/utilsac/utility.js\";\n```\n\n\n## deep.js\n\nConsider [structuredClone](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/structuredClone) if you need deepCopy\n\n```js\nimport {\n    deepCopy,\n    deepCopyAdded,\n    deepAssign,\n    deepAssignAdded,\n    deepEqual,\n    deepEqualAdded,\n    deepDifference,\n} from \"utilsac/deep.js\";\n\n// deno\nimport {\n    deepCopy,\n    deepCopyAdded,\n    deepAssign,\n    deepAssignAdded,\n    deepEqual,\n    deepEqualAdded,\n    deepDifference,\n} from \"https://unpkg.com/utilsac/deep.js\";\n```\n\n\n### deepEqual example\n\n```js \nconst personA = { email: 'example@email.com', name: { firstname: 'James', lastname: 'William' }};\n\nconst personB = { email: 'example@email.com', name: { firstname: 'James', lastname: 'William' }};\n\ndeepEqual(personA, personB); //  true\n```\n\n\n## typeCast.js\n\n```js\nimport {\n    stringFromArrayBuffer,\n    arrayBufferFromBlob,\n    stringFromBlob,\n    stringFromArray,\n    setFromArray,\n    mapFromObject,\n} from \"utilsac/typeCast.js\";\n\n// deno\nimport {\n    deepCopy,\n    deepCopyAdded,\n    deepAssign,\n    deepAssignAdded,\n    deepEqual,\n    deepEqualAdded,\n    deepDifference,\n} from \"https://unpkg.com/utilsac/typeCast.js\";\n```\n\n## typeCastNode.js\n\n```js\nimport {\n    blobPromiseFromStream,\n} from \"utilsac/typeCastNode.js\";\n```\n\n## browserUtility.js\n\n```js\nimport { \n    evalGlobal,\n    downloadBlob,\n} from \"utilsac/browserUtility.js\";\n```\n\n```js\nevalGlobal(`window.x = 2 ** 10`);\n```\n\nAfter the Promise is resolved the code has executed in global scope.\n\n\n```js\nevalGlobal(`\nimport sin form \"./x.js\";\nwindow.x = sin(Math.PI)\n`, `module`);\n```\n\nUse optional second argument with `module` to be able to use static imports\n\n\n## About\n\n### Changelog\n\n[Changelog](./changelog.md)\n\n\n### License\n\n[CC0](./license.txt)\n\n### Related\n\n * [JSON.prune to handle circular objects](https://github.com/Canop/JSON.prune)\n * [stackoverflow answer to clone prototypes](https://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-deep-clone-an-object-in-javascript)\n * [fnk utility functions](https://github.com/seanohue/fnk)\n * [lodash utility functions](https://lodash.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrossacasac%2Futilsac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrossacasac%2Futilsac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrossacasac%2Futilsac/lists"}