{"_id":"@codebundlesbyvik/js-helpers","_rev":"9-98d9fd25711c63e2ed32ef679191e427","name":"@codebundlesbyvik/js-helpers","dist-tags":{"latest":"2.2.0"},"versions":{"1.0.0":{"name":"@codebundlesbyvik/js-helpers","version":"1.0.0","keywords":["es6","typescript","ts","helpers","lightweight","css","create","fetch","get","strip","dom","element","number","int","prop","value","unit","average","duration","milliseconds","ms","motion","promise","time","timeout","sleep","wait"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@1.0.0","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"177f1a0480616b9e42d7dbb9fe6b6b37430b4c61","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-1.0.0.tgz","fileCount":37,"integrity":"sha512-lbm5uKQMakIUgo1T1UQkPcH3PPYF2k48ZEdPiUYR6kcxvVpOunhuU9vk0kjWxgv4y0TCB/b6x89MkPPAKuJbYA==","signatures":[{"sig":"MEUCIHkISvgvQpobuv3lVnNqHsWb1xbQcH0WAla3icxkrMBvAiEAjEDErvfQxOmjeMs+7PUgVCOmxNI8M2LYDrwWZkYz88o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68372},"type":"module","engines":{"node":">=12.22.0"},"exports":{".":{"types":"./dist/types/index.d.ts","module":"./dist/index.js","default":"./dist/index.umd.js"}},"gitHead":"e9054f88219fa3a7ac5183c6066dc50bbe52a1cf","scripts":{"lint":"eslint * src/** tests/** --config .eslintrc.cjs","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.cjs","minify":"node terser.config.cjs","lint-fix":"eslint * src/** tests/** --config .eslintrc.cjs --fix","compile-js":"babel src --out-dir dist --extensions .ts","make-bundle":"rollup --config rollup.config.js","make-release":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run generate-types && npm run compile-js && npm run make-bundle && npm run minify","generate-types":"tsc"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"type":"git","repository":"git+https://github.com/vikputthiscodeongit/js-helpers.git"},"_npmVersion":"9.8.1","description":"JavaScript helper functions for various operations.","directories":{},"_nodeVersion":"18.18.2","browserslist":["> 0.1% and fully supports object-entries"],"dependencies":{"core-js":"^3.33.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.53.0","rimraf":"^5.0.5","rollup":"^4.3.0","terser":"^5.24.0","ts-jest":"^29.1.1","prettier":"^3.0.3","cross-env":"^7.0.3","@babel/cli":"^7.23.0","typescript":"^5.2.2","@babel/core":"^7.23.2","@babel/preset-env":"^7.23.2","@tsconfig/recommended":"^1.0.3","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","@rollup/plugin-commonjs":"^25.0.7","@babel/preset-typescript":"^7.23.2","@typescript-eslint/parser":"^6.9.1","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^6.9.1"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_1.0.0_1699185685762_0.592643450839764","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@codebundlesbyvik/js-helpers","version":"2.0.0","keywords":["helpers","utilities","lightweight","small","create","convert","fetch","get","strip","motion","number","element","css","attribute","prop","duration","milliseconds","ms","average","unit","promise","timeout","sleep","wait","esm","module","modules","typescript","typed"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.0.0","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"120e8a8e1d95158a61d9d87beb6d68db59c969cf","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.0.0.tgz","fileCount":33,"integrity":"sha512-1bof2ywRaMF2yU/MNsfxR8h/V7AVF50xm9s/9MTLMW4LfU+YHZ1H5zLTuMqza59DN/nVZOJzU2GPfyLCDuxvRg==","signatures":[{"sig":"MEYCIQC5D0gy9an6yc30TI2HrMfuYa7gImfAVoHidfenQ9miTgIhALabFS7iQg+5/9j7LJhSekp+HSa8xjHxVHwegkWkTBPA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21570},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"478c70256707373a016eb98f07582966dbe3fb1a","scripts":{"lint":"eslint","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.cjs --coverage","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile-js && npm run minify && npm run generate-types","minify":"node terser.config.cjs","lint-fix":"eslint --fix","build-dev":"cross-env NODE_ENV=development rimraf dist && npm run compile-js && npm run generate-types","compile-js":"babel src --out-dir dist --extensions .ts","generate-types":"tsc"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"type":"git","repository":"https://github.com/vikputthiscodeongit/js-helpers.git"},"_npmVersion":"10.8.2","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"20.17.0","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.10.0","rimraf":"^6.0.1","terser":"^5.32.0","globals":"^15.9.0","ts-jest":"^29.2.5","prettier":"^3.3.3","cross-env":"^7.0.3","@babel/cli":"^7.25.6","@eslint/js":"^9.10.0","typescript":"^5.6.2","@babel/core":"^7.25.2","@babel/preset-env":"^7.25.4","typescript-eslint":"^8.5.0","@tsconfig/recommended":"^1.0.7","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jest-environment-jsdom":"^29.7.0","@babel/preset-typescript":"^7.24.7"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.0.0_1726411524664_0.48722617094484955","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@codebundlesbyvik/js-helpers","version":"2.1.0","keywords":["helpers","utilities","lightweight","small","create","convert","fetch","get","strip","motion","number","element","css","attribute","prop","duration","milliseconds","ms","average","unit","promise","timeout","sleep","wait","esm","module","modules","typescript","typed"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.1.0","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"b68569e6c859f9e90d041cc9df441be3d7941284","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.1.0.tgz","fileCount":33,"integrity":"sha512-ebKNHiMMk55SmNu39pyKAcXFXmnNK6qjrLOjJScDHlSyqBkpMCLOAIzHiqA4502s06X3JYVkL4w8e3UHPaoa9Q==","signatures":[{"sig":"MEUCIDe2M+/olpbgRE/zRL1ZP+gjqrnIhSyHTBJNjj05kwtyAiEA3VS3ZSv8JSvlqWHs8I9Hl7LiYwVs0IH0CHtR4a0kiV4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21697},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"bbcefa90f02e633141a6385341e467bef830978d","scripts":{"lint":"eslint","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.cjs --coverage","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile-js && npm run minify && npm run generate-types","minify":"node terser.config.cjs","lint-fix":"eslint --fix","build-dev":"cross-env NODE_ENV=development rimraf dist && npm run compile-js && npm run generate-types","compile-js":"babel src --out-dir dist --extensions .ts","generate-types":"tsc"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"type":"git","repository":"https://github.com/vikputthiscodeongit/js-helpers.git"},"_npmVersion":"10.8.2","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"20.17.0","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.10.0","rimraf":"^6.0.1","terser":"^5.32.0","globals":"^15.9.0","ts-jest":"^29.2.5","prettier":"^3.3.3","cross-env":"^7.0.3","@babel/cli":"^7.25.6","@eslint/js":"^9.10.0","typescript":"^5.6.2","@babel/core":"^7.25.2","@babel/preset-env":"^7.25.4","typescript-eslint":"^8.5.0","@tsconfig/recommended":"^1.0.7","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jest-environment-jsdom":"^29.7.0","@babel/preset-typescript":"^7.24.7"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.1.0_1726423365442_0.19302754199467498","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"@codebundlesbyvik/js-helpers","version":"2.1.1","keywords":["helpers","utilities","lightweight","small","create","convert","fetch","get","strip","motion","number","element","css","attribute","prop","duration","milliseconds","ms","average","unit","promise","timeout","sleep","wait","esm","module","modules","typescript","typed"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.1.1","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"b1943abbf62113cc4dae2164b6e22bbd644a471b","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.1.1.tgz","fileCount":23,"integrity":"sha512-GIihG7wuh0njT07o5e87JEYReTYNNBRFpK42xqrYz4ay6aA50tPm0zQpD7Wxt1aweAJTWx0+nCt4xEWj3cWwAg==","signatures":[{"sig":"MEUCIEBHvCb/WBpMjYDrJ+6gfAzkLWN+k203ZhRT1a+QAij9AiEA21pasf6tGDZ3qu+ms+4LVMc3hkhnhnrOQYPhHuqSX1M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18463},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"cfe0ae389dd454ffeb16b81e61730fff8a364429","scripts":{"lint":"eslint","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.cjs --coverage","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile-js && npm run minify && npm run generate-types","minify":"node terser.config.cjs","lint-fix":"eslint --fix","build-dev":"cross-env NODE_ENV=development rimraf dist && npm run compile-js && npm run generate-types","compile-js":"babel src --out-dir dist --extensions .ts","generate-types":"tsc"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"url":"git+https://github.com/vikputthiscodeongit/js-helpers.git","type":"git"},"_npmVersion":"10.9.2","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"22.14.0","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.21.0","rimraf":"^6.0.1","terser":"^5.39.0","globals":"^16.0.0","ts-jest":"^29.2.6","prettier":"^3.5.2","cross-env":"^7.0.3","@babel/cli":"^7.26.4","@eslint/js":"^9.21.0","typescript":"^5.7.3","@babel/core":"^7.26.9","@babel/preset-env":"^7.26.9","typescript-eslint":"^8.25.0","@tsconfig/recommended":"^1.0.8","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.3","jest-environment-jsdom":"^29.7.0","@babel/preset-typescript":"^7.26.0"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.1.1_1740491632165_0.0811262395661072","host":"s3://npm-registry-packages-npm-production"}},"2.1.2":{"name":"@codebundlesbyvik/js-helpers","version":"2.1.2","keywords":["helpers","utilities","lightweight","small","create","convert","fetch","get","strip","motion","number","element","css","attribute","prop","duration","milliseconds","ms","average","unit","promise","timeout","sleep","wait","esm","module","modules","typescript","typed"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.1.2","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"9dc3c0040abbc14c917f602e398f20a3057bbada","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.1.2.tgz","fileCount":23,"integrity":"sha512-KzsOeEWT603VSFgteYXKZ3frEDWtbZnGS1iQyqq8L4pLP2iLdjDBb5hzYf1sRDEDM+wHXdaWVYxLb8aJMSFmQA==","signatures":[{"sig":"MEUCIQCjM1SRd3ZLTxHEV4qTZZDAS0F+GD2BYBhruF1GndlhCwIgA41R8bH4okFIkCTCEd8gkFg3LZX2S2tqRPTN1rfQOJM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18396},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"01edbc8e766e7d0a513a4e02264b65565280c457","scripts":{"lint":"eslint","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.cjs --coverage","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile-js && npm run minify && npm run generate-types","minify":"node terser.config.cjs","lint-fix":"eslint --fix","build-dev":"cross-env NODE_ENV=development rimraf dist && npm run compile-js && npm run generate-types","compile-js":"babel src --out-dir dist --extensions .ts","generate-types":"tsc"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"url":"git+https://github.com/vikputthiscodeongit/js-helpers.git","type":"git"},"_npmVersion":"11.1.0","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"22.14.0","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.22.0","rimraf":"^6.0.1","terser":"^5.39.0","globals":"^16.0.0","ts-jest":"^29.2.6","prettier":"^3.5.3","cross-env":"^7.0.3","@babel/cli":"^7.26.4","@eslint/js":"^9.22.0","typescript":"^5.8.2","@babel/core":"^7.26.9","@babel/preset-env":"^7.26.9","typescript-eslint":"^8.26.1","@tsconfig/recommended":"^1.0.8","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.3","jest-environment-jsdom":"^29.7.0","@babel/preset-typescript":"^7.26.0"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.1.2_1741707194164_0.8894337720245069","host":"s3://npm-registry-packages-npm-production"}},"2.1.3":{"name":"@codebundlesbyvik/js-helpers","version":"2.1.3","keywords":["helpers","utilities","lightweight","small","create","convert","fetch","get","strip","motion","number","element","css","attribute","prop","duration","milliseconds","ms","average","unit","promise","timeout","sleep","wait","esm","module","modules","typescript","typed"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.1.3","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"e2317e1ce290df888966e2e6ff747b8fc618a495","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.1.3.tgz","fileCount":23,"integrity":"sha512-NAvYoADb+LKZqmNqbhxN98ThS5wOGGu6fsjy1Yu6osQ5rZsDEysDtmuGHJEhyQlUSA87k1aR4eSPiVfBI+QBZw==","signatures":[{"sig":"MEUCIGLpvS+3vhKq/WGbmyAGJ1Dl4xk+dHz3YH+0ktf+UTvhAiEAo28GoL2mA7OkJRxpu88tvGZiqmlWkz0t8R7s4/Z+5+g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18427},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"010678ade386438d0ed652499aef0d3a62975a72","scripts":{"lint":"eslint","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest --config=jest.config.cjs --coverage","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile-js && npm run minify && npm run generate-types","minify":"node terser.config.cjs","lint-fix":"eslint --fix","build-dev":"cross-env NODE_ENV=development rimraf dist && npm run compile-js && npm run generate-types","compile-js":"babel src --out-dir dist --extensions .ts","generate-types":"tsc"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"url":"git+https://github.com/vikputthiscodeongit/js-helpers.git","type":"git"},"_npmVersion":"10.9.2","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"22.15.1","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9.27.0","rimraf":"^6.0.1","terser":"^5.39.2","globals":"^16.1.0","ts-jest":"^29.3.4","prettier":"^3.5.3","cross-env":"^7.0.3","@babel/cli":"^7.27.2","@eslint/js":"^9.27.0","typescript":"^5.8.3","@babel/core":"^7.27.1","@babel/preset-env":"^7.27.2","typescript-eslint":"^8.32.1","@tsconfig/recommended":"^1.0.8","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.4.0","jest-environment-jsdom":"^29.7.0","@babel/preset-typescript":"^7.27.1"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.1.3_1747853034258_0.11322946623993446","host":"s3://npm-registry-packages-npm-production"}},"2.1.4":{"name":"@codebundlesbyvik/js-helpers","version":"2.1.4","keywords":["helpers","utility","utilities","light","small","create","convert","fetch","get","generate","strip","motion","sleep","element","css","attribute","property","duration","ms","number","time","average","unit","promise","timeout","wait","esm","module","ts","typescript"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.1.4","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"166073c31403576943a56bef71603316c62925fd","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.1.4.tgz","fileCount":23,"integrity":"sha512-acpYbv+4nku4b47eo4m8gCLTzLeFtBUsmY6ffrsswxjedGQditc2Joiwvucyg449F+x/YjTnWhDrOqJCBHyYWA==","signatures":[{"sig":"MEUCIE1stBDEPYtJhWyAduioAO5ZSeHE60ROGgEbufFwaY5/AiEA4vKryGipE1iFHE1o+v+c91lvzUaiwNZMVT9QFSNJty0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17878},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"c8b828d915b519d143bd2a26e4dcb2572dd6155d","scripts":{"test":"vitest run","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile && npm run minify","minify":"node terser.config.cjs","compile":"tsc","lint-fix":"eslint --fix"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"url":"git+https://github.com/vikputthiscodeongit/js-helpers.git","type":"git"},"_npmVersion":"10.9.3","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"22.20.0","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.0.0","eslint":"^9.36.0","rimraf":"^6.0.1","terser":"^5.44.0","vitest":"^3.2.4","globals":"^16.4.0","prettier":"^3.6.2","cross-env":"^10.1.0","@eslint/js":"^9.36.0","typescript":"^5.9.3","typescript-eslint":"^8.45.0","@vitest/coverage-v8":"^3.2.4","@tsconfig/recommended":"^1.0.10","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.1.4_1759493824106_0.10608776472715875","host":"s3://npm-registry-packages-npm-production"}},"2.1.5":{"name":"@codebundlesbyvik/js-helpers","version":"2.1.5","keywords":["helpers","utility","utilities","light","small","create","convert","fetch","get","generate","strip","motion","sleep","element","css","attribute","property","duration","ms","number","time","average","unit","promise","timeout","wait","esm","module","ts","typescript"],"author":{"name":"codebundlesbyvik"},"license":"MIT","_id":"@codebundlesbyvik/js-helpers@2.1.5","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"dist":{"shasum":"8c0c885b02203dd5f8e7311d09d8b9380e20d173","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.1.5.tgz","fileCount":23,"integrity":"sha512-OcXQ66m/rmGWLyGoAkwxTAsQmpa6WTcRliqM3Wbu7NW/I+/PGHIjSsUS3SgOdt+hCwEozLZYX0h5MdSTvmQagA==","signatures":[{"sig":"MEUCIQDjoaXt95DldeGsITGbdwXYLFMrqiSCzlKaFBZ2SnO4JwIgYJZkAI9o8TTJh8SGtuo+RnPkH/X423DpT/5d3KKfK5w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17935},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","engines":{"node":">=12.22.0"},"gitHead":"eea889f878ab40758962756b6277fec2cd80921f","scripts":{"test":"vitest run","build":"cross-env NODE_ENV=production npm run lint-fix && npm run test && rimraf dist && npm run compile && npm run minify","minify":"node terser.config.cjs","compile":"tsc","lint-fix":"eslint --fix"},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"repository":{"url":"git+https://github.com/vikputthiscodeongit/js-helpers.git","type":"git"},"_npmVersion":"10.9.3","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","directories":{},"_nodeVersion":"22.20.0","browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.0.0","eslint":"^9.37.0","rimraf":"^6.0.1","terser":"^5.44.0","vitest":"^3.2.4","globals":"^16.4.0","prettier":"^3.6.2","cross-env":"^10.1.0","@eslint/js":"^9.37.0","typescript":"^5.9.3","typescript-eslint":"^8.46.0","@vitest/coverage-v8":"^3.2.4","@tsconfig/recommended":"^1.0.10","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4"},"_npmOperationalInternal":{"tmp":"tmp/js-helpers_2.1.5_1759940067392_0.6976643827402018","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@codebundlesbyvik/js-helpers","version":"2.2.0","description":"0-dependency JavaScript helper functions for various operations, used across my projects.","keywords":["helpers","utility","utilities","light","small","create","convert","fetch","get","generate","strip","motion","sleep","element","css","attribute","property","duration","ms","number","time","average","unit","promise","timeout","wait","esm","module","ts","typescript"],"license":"MIT","author":{"name":"codebundlesbyvik"},"repository":{"type":"git","url":"git+https://github.com/vikputthiscodeongit/js-helpers.git"},"bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"main":"./dist/index.js","types":"./dist/types/index.d.ts","type":"module","scripts":{"lint-fix":"eslint --fix","test":"vitest run","compile":"tsc","minify":"node terser.config.cjs","build":"npm run lint-fix && cross-env NODE_ENV=production npm run test && rimraf dist && cross-env NODE_ENV=production npm run compile && npm run minify"},"devDependencies":{"@eslint/js":"^9.39.1","@tsconfig/recommended":"^1.0.11","@vitest/coverage-v8":"^4.0.6","cross-env":"^10.1.0","eslint":"^9.39.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","globals":"^16.5.0","jsdom":"^27.1.0","prettier":"^3.6.2","rimraf":"^6.1.0","terser":"^5.44.0","typescript":"^5.9.3","typescript-eslint":"^8.46.3","vitest":"^4.0.6"},"engines":{"node":">=12.22.0"},"browserslist":["> 0.1%","last 3 versions and not dead","Firefox ESR"],"gitHead":"becba8a45803d9038b9dba6614e8d0133c50deb3","_id":"@codebundlesbyvik/js-helpers@2.2.0","homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-TXbPDI7KIknbkPJoxN1CVwboy+EHn46nC7I4Dp6QaTUNk7s7qrokugtMRbUrhaTJRRy8jV9qbkco1NNXpgTokg==","shasum":"73c93b3007bb997bbdad40061479319176a60bdd","tarball":"https://registry.npmjs.org/@codebundlesbyvik/js-helpers/-/js-helpers-2.2.0.tgz","fileCount":23,"unpackedSize":18090,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAXUrdTxWmeeaZryk7Pnc3gQw+H6irh1YLEBgEaS2UBqAiEA7tn8AeqiJYQI472HlzPSM7VKxR2kL7BR3r/geYV9dJI="}]},"_npmUser":{"name":"codebundlesbyvik","email":"code@viktorchin.nl"},"directories":{},"maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/js-helpers_2.2.0_1762216221418_0.38664056081946807"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-05T12:01:25.677Z","modified":"2025-11-04T00:30:22.136Z","1.0.0":"2023-11-05T12:01:26.016Z","2.0.0":"2024-09-15T14:45:24.848Z","2.1.0":"2024-09-15T18:02:45.580Z","2.1.1":"2025-02-25T13:53:52.390Z","2.1.2":"2025-03-11T15:33:14.342Z","2.1.3":"2025-05-21T18:43:54.431Z","2.1.4":"2025-10-03T12:17:04.279Z","2.1.5":"2025-10-08T16:14:27.575Z","2.2.0":"2025-11-04T00:30:21.607Z"},"bugs":{"url":"https://github.com/vikputthiscodeongit/js-helpers/issues"},"author":{"name":"codebundlesbyvik"},"license":"MIT","homepage":"https://github.com/vikputthiscodeongit/js-helpers#readme","keywords":["helpers","utility","utilities","light","small","create","convert","fetch","get","generate","strip","motion","sleep","element","css","attribute","property","duration","ms","number","time","average","unit","promise","timeout","wait","esm","module","ts","typescript"],"repository":{"type":"git","url":"git+https://github.com/vikputthiscodeongit/js-helpers.git"},"description":"0-dependency JavaScript helper functions for various operations, used across my projects.","maintainers":[{"name":"codebundlesbyvik","email":"code@viktorchin.nl"}],"readme":"# js-helpers\n[![npm](https://img.shields.io/npm/v/@codebundlesbyvik/js-helpers)](https://www.npmjs.com/package/@codebundlesbyvik/js-helpers)\n[![npm - downloads per week](https://img.shields.io/npm/dw/@codebundlesbyvik/js-helpers)](https://www.npmjs.com/package/@codebundlesbyvik/js-helpers)\n\n0-dependency JavaScript helper functions for various operations, used across my projects.\n\n<br>\n\n## Table of Contents\n* [Compatibility](#compatibility)\n* [Usage](#usage)\n* [Functions](#functions)\n  * [createEl](#createeltagname-attrs)\n  * [cssDurationToMs](#cssdurationtomsduration)\n  * [fetchWithTimeout](#fetchwithtimeoutresource-fetchoptions-timeoutduration)\n  * [getAverage](#getaveragearray-round)\n  * [getCssPropValue](#getcsspropvalueel-prop)\n  * [getCssUnit](#getcssunitvalue)\n  * [getPseudoRandomIntBetween](#getpseudorandomintbetweenmin-max)\n  * [isMotionAllowed](#ismotionallowed)\n  * [wait](#waitduration-resolvevalue-abortsignal)\n* [Migrating](#migrating)\n  * [From version 1](#from-version-1)\n  * [From `@codebundlesbyvik/js-*-operations`](#from-codebundlesbyvikjs--operations)\n* [License](#license)\n\n<br>\n\n## Compatibility\nAll helpers are compatible with the ECMAScript 2015 (ES6) specification except for `fetchWithTimeout` which requires an ECMAScript 2017 (ES8) compatible environment.\n\nSome helpers utilize DOM methods and as such require an environment that supports those.\n\n<br>\n\n## Usage\n### With a module bundler\nInstall the package with npm.\n\n``` shell\nnpm install @codebundlesbyvik/js-helpers\n```\n\nImport the helpers you need...\n\n``` javascript\nimport { getCssPropValue } from \"@codebundlesbyvik/js-helpers\";\n```\n\n... and build your project.\n\n<br>\n\n### Without a module bundler\n[Download the latest release from GitHub](https://github.com/vikputthiscodeongit/js-helpers/releases/latest) and import the helpers you need as an ES Module.\n\n<br>\n\n## Functions\n* [createEl](#createeltagname-attrs)\n* [cssDurationToMs](#cssdurationtomsduration)\n* [fetchWithTimeout](#fetchwithtimeoutresource-fetchoptions-timeoutduration)\n* [getAverage](#getaveragearray-round)\n* [getCssPropValue](#getcsspropvalueel-prop)\n* [getCssUnit](#getcssunitvalue)\n* [getPseudoRandomIntBetween](#getpseudorandomintbetweenmin-max)\n* [isMotionAllowed](#ismotionallowed)\n* [wait](#waitduration-resolvevalue-abortsignal)\n\n<br>\n\n### `createEl(tagName, attrs)`\nCreate and return an `HTMLElement`.\n\n#### Parameters\n* `tagName` (`string`): The `HTMLElement`'s tag name.\n* `attrs?` (`object`): Individual attribute - value pairs to set on the `HTMLElement`.\n\nUse the `textContent` attribute to set the `HTMLElement`'s `textContent`.\n\n#### Example\n```javascript\ncreateEl(\"div\", {\n    class: \"example-div\",\n    id: \"example-div-1\",\n    ariaHidden: \"true\",\n    textContent: \"This is an example.\"\n});\n\n// <div class=\"example-div\" id=\"example-div-1\" aria-hidden=\"true\">\n//     This is an example\n// </div>\n```\n\n<br>\n\n### `cssDurationToMs(duration)`\nConvert a CSS-style time duration value to a `number` of milliseconds.\n\nIf the given value has no or an unrecognized unit, the returned value will be `null`.\n\n#### Parameters\n* `duration` (`string`): 'CSS-style' time duration.\n\n#### Supported units\n* `ms`: Milliseconds\n* `s`: Seconds\n* `h`: Hours\n* `d`: Days\n* `w`: Weeks\n\n#### Example\n``` javascript\ncssDurationToMs(\"150ms\");\n// 150\n\ncssDurationToMs(\"2s\");\n// 2000\n\ncssDurationToMs(\"0.25d\");\n// 21600000\n\ncssDurationToMs(\"-1w\");\n// -604800000\n\ncssDurationToMs(\"1y\");\n// null\n\ncssDurationToMs(\"1asdf\");\n// null\n\ncssDurationToMs(\"20\");\n// null\n```\n\n<br>\n\n### `fetchWithTimeout(resource, fetchOptions, timeoutDuration)`\nMake a `fetch()` call that's aborted by an `AbortController` after a specified amount of time.\n\n#### Parameters\n* `resource` (`RequestInfo` | `URL`): Location of the resource. See [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and/or [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL).\n* `fetchOptions = {}` (`RequestInit`): Options for fetch(). See [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit).\n* `timeoutDuration = 8000` (`number`): Time in milliseconds after which `AbortController.abort()` is called and the `fetch()` is aborted.\n\n#### Example\n``` javascript\n// Make a GET request that's aborted if no response is returned within 8 seconds.\nawait fetchWithTimeout(\"https://example.com/api/endpoint\");\n\n// Make a POST request that's aborted if no response is returned within 10 seconds.\nawait fetchWithTimeout(\"https://example.com/api/endpoint\", { method: \"POST\" }, 10000);\n```\n\n<br>\n\n### `getAverage(array, round)`\nGet the average of an array of `number`s.\n\n#### Parameters\n* `array` (`number[]`): Array to check.\n* `round?` (`\"nearest\"` | `\"floor\"` | `\"ceil\"`): Rounding method to apply to the average.\n\n#### Example\n``` javascript\ngetAverage([1, 2, 3]);\n// 2\n\ngetAverage([3, 8, 41, 88, 1024]);\n// 232.8\n\ngetAverage([3, 8, 41, 88, 1024], \"nearest\");\n// 233\n\ngetAverage([3, 8, 41, 88, 1024], \"floor\");\n// 232\n\ngetAverage([0.1, 0.33, 0.82, 1], \"ceil\");\n// 1\n```\n\n<br>\n\n### `getCssPropValue(el, prop)`\nGet an `Element`'s CSS property value.\n\nIf the property is not set or unknown, the returned value will be `null`.\n\n#### Parameters\n* `el` (`Element`): The target.\n* `prop` (`string`): `Element` property to retrieve.\n\n#### Example\n``` javascript\nconst el = document.querySelector(\"#example-div-1\");\n// Has the following properties set:\n// margin-bottom: 0.75rem;\n// background-color: black;\n\ngetCssPropValue(el, \"margin-bottom\");\n// \"0.75rem\"\n\ngetCssPropValue(el, \"background-color\");\n// \"black\"\n\ngetCssPropValue(el, \"box-shadow\");\n// null\n\ngetCssPropValue(el, \"non-existent\");\n// null\n```\n\n<br>\n\n### `getCssUnit(value)`\nGet the unit of a quantitative 'CSS-style' value.\n\nIf the value has no unit, the returned value will be `null`.\n\n#### Parameters\n* `value` (`string`): 'CSS-style' value to get the unit from.\n\n#### Example\n``` javascript\ngetCssUnit(\"2px\");\n// \"px\"\n\ngetCssUnit(\".5ms\");\n// \"ms\"\n\ngetCssUnit(\"100\");\n// null\n```\n\n<br>\n\n### `getPseudoRandomIntBetween(min, max)`\nGenerate and return a positive pseudo-random integer between two given integers.\n\n⚠️ **Makes use of [Math.random()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random), which ISN'T cryptographically secure. YOU WILL BE FIRED if you use this helper in production in an attempt to generate secure, random integers.** ⚠️\n\n#### Parameters\n* `min` (`number`): Positive integer relative to which the returned integer will be equal to or greater than.\n* `max` (`number`): Positive integer relative to which the returned integer will be smaller than.\n\n#### Example\n```javascript\ngetPseudoRandomIntBetween(0, 10);\n// 7\n```\n\n<br>\n\n### `isMotionAllowed()`\nCheck if `prefers-reduced-motion` is set to something other than `reduce`. Returns a `Boolean`.\n\n#### Parameters\n* None\n\n#### Example\n``` javascript\n// 'prefers-reduced-motion: reduce'\nisMotionAllowed();\n// false\n\n// 'prefers-reduced-motion: no-preference'\nisMotionAllowed();\n// true\n\n// 'prefers-reduced-motion' is unsupported.\nisMotionAllowed();\n// true\n```\n\n<br>\n\n### `wait(duration, resolveValue, abortSignal)`\nWait for a given amount of time before continuing function execution.\n\n`setTimeout()` wrapped in a `Promise`, which is optionally resolved with `resolveValue` and cancellable via an `AbortController`.\n\n#### Parameters\n* `duration` (`number`): Time in milliseconds after which script execution will continue.\n* `resolveValue?` (Any valid `Promise.resolve()` value): Value which the promise will be resolved with.\n* `abortSignal?` (`AbortSignal`): `AbortController.signal` which the timeout can be cancelled with.\n\n#### Example\n``` javascript\n// Wait for 3 seconds before doing something else.\nawait wait(3000);\n\n// Wait for 5 seconds before doing something else - or less if aborted earlier.\nconst abortController = new AbortController();\nawait wait(5000, \"5 seconds have passed\", abortController.signal);\n```\n\n<br>\n\n## Migrating\n### From version 1\nFunction parameters are now type checked.\n\nThe following changes are breaking:\n* **Removed**: `createEls()`\n  * Write this code yourself - it was just a `for` loop.\n* **Removed**: `getRandomIntBelow()`\n  * Use `getPseudoRandomIntBetween(0, x)` instead.\n* **Removed**: `getCssUnit()` support for `y` unit.\n* **Changed**: `wait()` parameter 3 changed from an `AbortController` to an `AbortSignal`\n\n### From `@codebundlesbyvik/js-*-operations`\nFunction parameters are now type checked.\n\nThe following changes are breaking:\n* **Removed**: `createEls()`\n  * Write this code yourself - it was just a `for` loop.\n* **Removed**: `getRandomIntUnder()`\n  * Use `getPseudoRandomIntBetween(0, x)` instead.\n* **Renamed**: `getPropValue()` > `getCssPropValue()`\n* **Renamed**: `getUnit()` > `getCssUnit()`\n* **Renamed**: `timeToMs()` > `cssDurationToMs()`\n\nMore changes were made other than the ones listed above. Problems caused by incompatible changes should be easy to debug by the error thrown.\n\n<br>\n\n## License\nMIT © 2025 [Viktor Chin-Kon-Sung](https://github.com/vikputthiscodeongit)\n","readmeFilename":"README.md"}