{"id":19977437,"url":"https://github.com/hypernym-studio/utils","last_synced_at":"2026-01-18T03:23:19.374Z","repository":{"id":168682664,"uuid":"644455801","full_name":"hypernym-studio/utils","owner":"hypernym-studio","description":"A collection of reusable utilities.","archived":false,"fork":false,"pushed_at":"2026-01-17T12:55:43.000Z","size":433,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-17T23:26:31.785Z","etag":null,"topics":["collection","helpers","javascript","kit","shared","types","typescript","utilities","utils"],"latest_commit_sha":null,"homepage":"","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/hypernym-studio.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":".github/codeowners","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":{"custom":["https://revolut.me/ivodolenc","https://paypal.me/ivodolenc"]}},"created_at":"2023-05-23T14:51:44.000Z","updated_at":"2026-01-17T12:53:17.000Z","dependencies_parsed_at":"2023-10-12T00:05:07.288Z","dependency_job_id":"a785d42c-4819-46e9-ac1a-57d889881cea","html_url":"https://github.com/hypernym-studio/utils","commit_stats":{"total_commits":72,"total_committers":2,"mean_commits":36.0,"dds":"0.20833333333333337","last_synced_commit":"603744335a949732e0ec11f99dc065cbce84f541"},"previous_names":["hypernym-studio/utils"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/hypernym-studio/utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernym-studio%2Futils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernym-studio%2Futils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernym-studio%2Futils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernym-studio%2Futils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypernym-studio","download_url":"https://codeload.github.com/hypernym-studio/utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypernym-studio%2Futils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["collection","helpers","javascript","kit","shared","types","typescript","utilities","utils"],"created_at":"2024-11-13T03:28:03.754Z","updated_at":"2026-01-18T03:23:19.349Z","avatar_url":"https://github.com/hypernym-studio.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e@hypernym/utils\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA collection of reusable utilities.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/hypernym-studio/utils\"\u003eRepository\u003c/a\u003e\n  \u003cspan\u003e✦\u003c/span\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@hypernym/utils\"\u003ePackage\u003c/a\u003e\n  \u003cspan\u003e✦\u003c/span\u003e\n  \u003ca href=\"https://github.com/hypernym-studio/utils/releases\"\u003eReleases\u003c/a\u003e\n  \u003cspan\u003e✦\u003c/span\u003e\n  \u003ca href=\"https://github.com/hypernym-studio/utils/discussions\"\u003eDiscussions\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cpre align=\"center\"\u003epnpm add @hypernym/utils\u003c/pre\u003e\n\n\u003cbr\u003e\n\n## Features\n\n- TypeScript friendly\n- Fully tree-shakeable\n- No dependencies\n\n## Installation\n\nInstall `@hypernym/utils` package:\n\n```sh\n# via pnpm\npnpm add @hypernym/utils\n```\n\n```sh\n# via npm\nnpm install @hypernym/utils\n```\n\n### CDN\n\nHere are some examples of how to integrate **Hyperutils** from a CDN via a script tag.\n\nAlso, it is possible to download files manually and serve them accordingly.\n\n#### ESM (minified)\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { isNull, isString, ... } from 'https://unpkg.com/@hypernym/utils/dist/index.min.js'\n\u003c/script\u003e\n```\n\n#### IIFE (minified)\n\n```html\n\u003cscript src=\"https://unpkg.com/@hypernym/utils/dist/index.iife.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const { isNull, isString, ... } = Hyperutils\n\u003c/script\u003e\n```\n\n#### UMD (minified)\n\n```html\n\u003cscript src=\"https://unpkg.com/@hypernym/utils/dist/index.umd.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const { isNull, isString, ... } = Hyperutils\n\u003c/script\u003e\n```\n\n## Usage\n\nAfter installation, import `utils` into your project:\n\n```ts\n// ESM \u0026 TS\nimport { isNull, isString, ... } from '@hypernym/utils'\n\n// ESM \u0026 TS\nimport { exists, copy, ... } from '@hypernym/utils/fs'\n\n// Types\nimport type { IsAny, RequiredDeep, ... } from '@hypernym/utils'\n```\n\n## is\n\n### isBrowser\n\nChecks if the code is running in the `browser`.\n\n```ts\nimport { isBrowser } from '@hypernym/utils'\n\nisBrowser // true\n```\n\n### isNull\n\nReturns a boolean if the given value is a `null`.\n\n```ts\nimport { isNull } from '@hypernym/utils'\n\nisNull(null) // true\n```\n\n### isUndefined\n\nReturns a boolean if the given value is a `undefined`.\n\n```ts\nimport { isUndefined } from '@hypernym/utils'\n\nisUndefined(undefined) // true\n```\n\n### isString\n\nReturns a boolean if the given value is a `string`.\n\n```ts\nimport { isString } from '@hypernym/utils'\n\nisString('@hypernym/utils') // true\n```\n\n### isStringEmpty\n\nReturns a boolean if the given value is an empty `string`.\n\n```ts\nimport { isStringEmpty } from '@hypernym/utils'\n\nisStringEmpty('') // true\n```\n\n### isBoolean\n\nReturns a boolean if the given value is a `boolean`.\n\n```ts\nimport { isBoolean } from '@hypernym/utils'\n\nisBoolean(true) // true\n```\n\n### isTrue\n\nReturns a boolean if the given value is a `true`.\n\n```ts\nimport { isTrue } from '@hypernym/utils'\n\nisTrue(true) // true\n```\n\n### isFalse\n\nReturns a boolean if the given value is a `false`.\n\n```ts\nimport { isFalse } from '@hypernym/utils'\n\nisFalse(false) // true\n```\n\n### isNumber\n\nReturns a boolean if the given value is a `number`.\n\n```ts\nimport { isNumber } from '@hypernym/utils'\n\nisNumber(33) // true\n```\n\n### isArray\n\nReturns a boolean if the given value is a `array`.\n\n```ts\nimport { isArray } from '@hypernym/utils'\n\nisArray([]) // true\n```\n\n### isArrayEmpty\n\nReturns a boolean if the given value is an empty `array`.\n\n```ts\nimport { isArrayEmpty } from '@hypernym/utils'\n\nisArrayEmpty([]) // true\n```\n\n### isObject\n\nReturns a boolean if the given value is a `object`.\n\n```ts\nimport { isObject } from '@hypernym/utils'\n\nisObject({}) // true\n```\n\n### isObjectEmpty\n\nReturns a boolean if the given value is an empty `object`.\n\n```ts\nimport { isObjectEmpty } from '@hypernym/utils'\n\nisObjectEmpty({}) // true\n```\n\n### isFunction\n\nReturns a boolean if the given value is a `Function`.\n\n```ts\nimport { isFunction } from '@hypernym/utils'\n\nisFunction(() =\u003e {}) // true\n```\n\n### isNanValue\n\nReturns a boolean if the given value is a `NaN`.\n\n```ts\nimport { isNaNValue } from '@hypernym/utils'\n\nisNaNValue(NaN) // true\n```\n\n### isRegExp\n\nReturns a boolean if the given value is a `RegExp`.\n\n```ts\nimport { isRegExp } from '@hypernym/utils'\n\nisRegExp(/^hypernym/) // true\n```\n\n### isMap\n\nReturns a boolean if the given value is a `Map`.\n\n```ts\nimport { isMap } from '@hypernym/utils'\n\nisMap(new Map()) // true\n```\n\n### isWeakMap\n\nReturns a boolean if the given value is a `WeakMap`.\n\n```ts\nimport { isWeakMap } from '@hypernym/utils'\n\nisWeakMap(new WeakMap()) // true\n```\n\n### isSet\n\nReturns a boolean if the given value is a `Set`.\n\n```ts\nimport { isSet } from '@hypernym/utils'\n\nisSet(new Set()) // true\n```\n\n### isWeakSet\n\nReturns a boolean if the given value is a `WeakSet`.\n\n```ts\nimport { isWeakSet } from '@hypernym/utils'\n\nisWeakSet(new WeakSet()) // true\n```\n\n### isSymbol\n\nReturns a boolean if the given value is a `symbol`.\n\n```ts\nimport { isSymbol } from '@hypernym/utils'\n\nisSymbol(Symboly('hypernym')) // true\n```\n\n### isDate\n\nReturns a boolean if the given value is a `Date`.\n\n```ts\nimport { isDate } from '@hypernym/utils'\n\nisDate(new Date()) // true\n```\n\n### isBigInt\n\nReturns a boolean if the given value is a `bigint`.\n\n```ts\nimport { isBigInt } from '@hypernym/utils'\n\nisBigInt(1n) // true\n```\n\n### isInfinity\n\nReturns a boolean if the given value is a `Infinity`.\n\n```ts\nimport { isInfinity } from '@hypernym/utils'\n\nisInfinity(Infinity) // true\n```\n\n### isURL\n\nReturns a boolean if the given value is a `URL`.\n\n```ts\nimport { isURL } from '@hypernym/utils'\n\nisURL(new URL('https://localhost:3000')) // true\n```\n\n### isError\n\nReturns a boolean if the given value is a `Error`.\n\n```ts\nimport { isError } from '@hypernym/utils'\n\nisError(new Error()) // true\n```\n\n### isPrimitive\n\nReturns a boolean if the given value is a `Primitive`.\n\n```ts\nimport { isPrimitive } from '@hypernym/utils'\n\nisPrimitive(true) // true\n```\n\n### isElement\n\nReturns a boolean if the given value is a `Element`.\n\n```ts\nimport { isElement } from '@hypernym/utils'\n\nisElement(el) // true\n```\n\n### isHtmlElement\n\nReturns a boolean if the given value is a `HTMLElement`.\n\n```ts\nimport { isHtmlElement } from '@hypernym/utils'\n\nisHtmlElement(htmlEl) // true\n```\n\n### isSvgElement\n\nReturns a boolean if the given value is a `SVGElement`.\n\n```ts\nimport { isSvgElement } from '@hypernym/utils'\n\nisSvgElement(svgEl) // true\n```\n\n### isNodeList\n\nReturns a boolean if the given value is a `NodeList`.\n\n```ts\nimport { isNodeList } from '@hypernym/utils'\n\nisNodeList(document.querySelectorAll('div')) // true\n```\n\n### isNodeListEmpty\n\nReturns a boolean if the given value is an empty `NodeList`.\n\n```ts\nimport { isNodeListEmpty } from '@hypernym/utils'\n\nisNodeListEmpty(document.querySelectorAll('divs')) // true\n```\n\n### isHtmlCollection\n\nReturns a boolean if the given value is a `HTMLCollection`.\n\n```ts\nimport { isHtmlCollection } from '@hypernym/utils'\n\nisHtmlCollection(document.getElementsByClassName('el')) // true\n```\n\n### isHtmlCollectionEmpty\n\nReturns a boolean if the given value is an empty `HTMLCollection`.\n\n```ts\nimport { isHtmlCollectionEmpty } from '@hypernym/utils'\n\nisHtmlCollectionEmpty(document.getElementsByClassName('els')) // true\n```\n\n## fs\n\n### exists\n\nChecks if the `file` or `directory` exists.\n\n```ts\nimport { exists } from '@hypernym/utils/fs'\n\nawait exists('dir/file.ts') // true\n```\n\n### read\n\nReads the entire contents of a `file`.\n\n```ts\nimport { read } from '@hypernym/utils/fs'\n\nawait read('dir/subdir/file.ts')\n```\n\n### readdir\n\nReads the contents of a `directory` recursively.\n\n```ts\nimport { readdir } from '@hypernym/utils/fs'\n\nawait readdir('dir/subdir')\n```\n\n### write\n\nWrites data to a `file` recursively.\n\n```ts\nimport { write } from '@hypernym/utils/fs'\n\nawait write('dir/subdir/file.ts', `console.log('Hello World!')`)\n```\n\n### copy\n\nCopies `files` or `directories` recursively.\n\nAccepts a single source or a range of sources.\n\n```ts\nimport { copy } from '@hypernym/utils/fs'\n\nawait copy('src/subdir/file.ts', './dist/subdir')\n```\n\n### mkdir\n\nCreates a `directory` recursively.\n\nAccepts a single path or a range of paths.\n\n```ts\nimport { mkdir } from '@hypernym/utils/fs'\n\nawait mkdir('src/subdir')\n```\n\n### remove\n\nRemoves `files` and `directories` recursively.\n\nAccepts a single path or a range of paths.\n\n```ts\nimport { remove } from '@hypernym/utils/fs'\n\nawait remove('src/subdir/file.ts')\n```\n\n## Types\n\n### Primitive\n\nMatches any primitive value.\n\n```ts\nimport type { Primitive } from '@hypernym/utils'\n\ntype OnlyPrimitives\u003cT\u003e = T extends Primitive ? T : never\n\ntype Filtered = OnlyPrimitives\u003cstring | number | {} | Date\u003e // string | number\n```\n\n### BuiltIn\n\nMatches any `Primitive`, `Date` or `RegExp` value.\n\n```ts\nimport type { BuiltIn } from '@hypernym/utils'\n\ntype OnlyBuiltIns\u003cT\u003e = T extends BuiltIn ? T : never\n\ntype Filtered = OnlyBuiltIns\u003cstring | Date | {} | RegExp\u003e // string | Date | RegExp\n```\n\n### IsNull\n\nReturns a boolean if the given type is a `null`.\n\n```ts\nimport type { IsNull } from '@hypernym/utils'\n\ntype A = IsNull\u003cnull\u003e // true\ntype B = IsNull\u003cstring\u003e // false\ntype C = IsNull\u003cundefined\u003e // false\n```\n\n### IsAny\n\nReturns a boolean if the given type is a `any`.\n\n```ts\nimport type { IsAny } from '@hypernym/utils'\n\ntype A = IsAny\u003cany\u003e // true\ntype B = IsAny\u003cstring\u003e // false\ntype C = IsAny\u003cunknown\u003e // false\n```\n\n### IsNever\n\nReturns a boolean if the given type is a `never`.\n\n```ts\nimport type { IsNever } from '@hypernym/utils'\n\ntype A = IsNever\u003cnever\u003e // true\ntype B = IsNever\u003cnumber\u003e // false\ntype C = IsNever\u003cundefined\u003e // false\n```\n\n### PartialDeep\n\nConstructs a type by recursively setting all properties as optional.\n\nUse `Partial\u003cT\u003e` for one level.\n\n```ts\nimport type { PartialDeep } from '@hypernym/utils'\n\ntype PartialObject = PartialDeep\u003cObject\u003e\n\n// Disables recursive mode for arrays and tuples.\ntype PartialObject = PartialDeep\u003cObject, { arrays: false }\u003e\n```\n\n### RequiredDeep\n\nConstructs a type by recursively setting all properties as required.\n\nUse `Required\u003cT\u003e` for one level.\n\n```ts\nimport type { RequiredDeep } from '@hypernym/utils'\n\ntype RequiredObject = RequiredDeep\u003cObject\u003e\n\n// Disables recursive mode for arrays and tuples.\ntype RequiredObject = RequiredDeep\u003cObject, { arrays: false }\u003e\n```\n\n## License\n\nDeveloped in 🇭🇷 Croatia, © Hypernym Studio.\n\nReleased under the [MIT](LICENSE.txt) license.\n","funding_links":["https://revolut.me/ivodolenc","https://paypal.me/ivodolenc"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypernym-studio%2Futils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypernym-studio%2Futils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypernym-studio%2Futils/lists"}