{"id":30157406,"url":"https://github.com/tokimon/vanillajs-helpers","last_synced_at":"2025-08-11T13:36:19.800Z","repository":{"id":7413542,"uuid":"45599363","full_name":"Tokimon/vanillajs-helpers","owner":"Tokimon","description":"Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS","archived":false,"fork":false,"pushed_at":"2023-10-31T11:54:25.000Z","size":1595,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T18:35:28.651Z","etag":null,"topics":["helpers","js","library","snippets","typescript","vanilla-js","vanillajs-helpers"],"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/Tokimon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-11-05T08:56:58.000Z","updated_at":"2022-08-23T15:23:20.000Z","dependencies_parsed_at":"2024-06-20T22:02:01.148Z","dependency_job_id":null,"html_url":"https://github.com/Tokimon/vanillajs-helpers","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/Tokimon/vanillajs-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tokimon%2Fvanillajs-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tokimon%2Fvanillajs-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tokimon%2Fvanillajs-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tokimon%2Fvanillajs-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tokimon","download_url":"https://codeload.github.com/Tokimon/vanillajs-helpers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tokimon%2Fvanillajs-helpers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269898740,"owners_count":24493072,"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-11T02:00:10.019Z","response_time":75,"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":["helpers","js","library","snippets","typescript","vanilla-js","vanillajs-helpers"],"created_at":"2025-08-11T13:36:16.133Z","updated_at":"2025-08-11T13:36:19.788Z","avatar_url":"https://github.com/Tokimon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./warning.png\" width=\"40\" /\u003e\u003cimg src=\"./warning.png\" width=\"40\" /\u003e\u003cimg src=\"./warning.png\" width=\"40\" /\u003e\n\u003ch1\u003e\n  This package has been moved to \u003ca href=\"https://www.npmjs.com/package/@jsfns/core\"\u003e@jsfns/core\u003c/a\u003e and is no longer maintained in this repository.\n\u003c/h1\u003e\n\n# Vanilla JS helpers\n\nThis is a collection of simple, no dependency, vanilla JS snippets with the aim\nof making it easier to work with vanilla JS.\n\nAll helpers are written in TypeScript and converted into various JS versions suiting your use case:\n\n- `.js`: ES 5+ syntax.\n- `.mjs`: ES 2020 syntax\n- `.cjs`: ES 2017 syntax + CommonJS `require` imports\n- `.d.ts`: TypeScript description files\n\n#### BROWSER SPECIFIC HELPERS\n\nThese helpers a JS platform agnostic, for browser specific helpers check out:\n[vanillajs-browser-helpers](https://github.com/Tokimon/vanillajs-browser-helpers)\n\n\n## ES version support\nAll methods are using latest techniques and generally no efforts have been made to\naccommodate older browsers which do not support certain features. Polyfills should\nbe used to fill the gap. This is intentional as the need for polyfills are ever\ndiminishing, with modern browsers (and Node environments) getting updated all the time the vast\nmajority of the methods will be supported at one point. Also, with compilers like Babel, polyfills can be included automatically in the build process, making it simple to ensure full support. Therefore it is more future proof and clutter free to leave fallbacks and polyfills out of\nthe methods and just focus on core functionality.\n\nOnly in few edge cases where a polyfill might be tricky to implement correctly for a given\nfunctionality, fallback functionality will be incorporated.\n\n**Note**  \nYou will have to add these snippets as part of your transpilation if you wish to have\nenable auto detection of polyfills.\n\n## Available methods\n\nMethod | Description\n------ | -----------\n[camelCase](http://tokimon.github.io/vanillajs-helpers/modules/_camelcase_) | Turn a phrase or word with different casing into a `camelCased` word.\n[capitalize](http://tokimon.github.io/vanillajs-helpers/modules/_capitalize_) | Capitalize Each Word In A Phrase.\n[chunkString](http://tokimon.github.io/vanillajs-helpers/modules/_chunkstring_) | Chop up a string into chunks of the desired length.\n[currencyFormat](http://tokimon.github.io/vanillajs-helpers/modules/_currencyformat_) | Format a number into a specific currency format like: $ 1.000,00.\n[dashed](http://tokimon.github.io/vanillajs-helpers/modules/_dashed_) | Turn a phrase or word with different casing into a `dashed-lowercase-phrase`.\n[formatNumber](http://tokimon.github.io/vanillajs-helpers/modules/_formatnumber_) | Format a number according to a given template like: 1.000,00.\n[hash](http://tokimon.github.io/vanillajs-helpers/modules/_hash_) | Create a unique hash from a string.\n[hexToNumber](http://tokimon.github.io/vanillajs-helpers/modules/_hextonumber_) | Convert Hexadecimal into a number (eg. b4 =\u003e 180).\n[hexToRGB](http://tokimon.github.io/vanillajs-helpers/modules/_hextorgb_) | Converts a Hexadecimal color to a RGB(A) color array.\n[isBoolean](http://tokimon.github.io/vanillajs-helpers/modules/_isboolean_) | Tests if a given object is a Boolean\n[isFunction](http://tokimon.github.io/vanillajs-helpers/modules/_isfunction_) | Tests if a given object is a Function\n[isGenerator](http://tokimon.github.io/vanillajs-helpers/modules/_isgenerator_) | Tests if a given object is a Generator function\n[isNumber](http://tokimon.github.io/vanillajs-helpers/modules/_isnumber_) | Tests if a given object is a Number\n[isObject](http://tokimon.github.io/vanillajs-helpers/modules/_isobject_) | Tests if a given object is an Object (plain object)\n[isString](http://tokimon.github.io/vanillajs-helpers/modules/_isstring_) | Tests if a given object is a String\n[leadingZero](http://tokimon.github.io/vanillajs-helpers/modules/_leadingzero_) | Make sure a number is a string of a given length with empty slots filled up with zeroes (0), like: 007\n[limitDecimals](http://tokimon.github.io/vanillajs-helpers/modules/_limitdecimals_) | Limit decimals of a floating number to a given length.\n[numberToHex](http://tokimon.github.io/vanillajs-helpers/modules/_numbertohex_) | Convert a number to a Hexadecimal representation (eg. 180 =\u003e b4).\n[objectType](http://tokimon.github.io/vanillajs-helpers/modules/_objecttype_) | Determine what type a given object is (string, array, etc.)\n[pascalCase](http://tokimon.github.io/vanillajs-helpers/modules/_pascalcase_) | Turn a phrase or word with different casing into a `PascalCased` word.\n[phrasify](http://tokimon.github.io/vanillajs-helpers/modules/_phrasify_) | Converts a word of a special casing or a phrase, into a space separated phrase.\n[promisefy](http://tokimon.github.io/vanillajs-helpers/modules/_promisefy_) | Converts a regular method using `(err, data)` type of callback into a method that returns a promise.\n[randomHexColor](http://tokimon.github.io/vanillajs-helpers/modules/_randomrgbcolor_) | Gives a random RGB color.\n[randomId](http://tokimon.github.io/vanillajs-helpers/modules/_randomid_) | Generates a random id string of a given length.\n[randomRGBColor](http://tokimon.github.io/vanillajs-helpers/modules/_randomrgbcolor_) | Gives a random RGB color.\n[RGBToHex](http://tokimon.github.io/vanillajs-helpers/modules/_rgbtohex_) | Converts a RGB color to a HEX color (eg. [255, 0, 0] =\u003e #ff0000)\n[safeDateChange](http://tokimon.github.io/vanillajs-helpers/modules/_safedatechange_) | Change to another date without jumping month (eg. if you are going from 31st of January to February you would normally end up in March).\n[snakeCase](http://tokimon.github.io/vanillajs-helpers/modules/_snakecase_) | Turn a phrase or word with different casing into a `snake_cased` word.\n[truncate](http://tokimon.github.io/vanillajs-helpers/modules/_truncate_) | Ensures a max length of a given string.\n[uniqueArray](http://tokimon.github.io/vanillajs-helpers/modules/_uniquearray_) | Make sure an Array only contains unique values.\n\n## Installation\n\n```\nnpm install vanillajs-helpers\n```\n\n```\nyarn add vanillajs-helpers\n```\n\n## Usage\n\n```ts\n// TypeScript modules\nimport camelCase from 'vanillajs-helpers/ts/camelCase';\ncamelCase('Camel cased phrase'); // camelCasedPhrase\n```\n\n```js\n// ES 6 Modules\nimport camelCase from 'vanillajs-helpers/camelCase';\ncamelCase('Camel cased phrase'); // camelCasedPhrase\n```\n\n```js\n// CommonJS Require Modules\nconst camelCase = require('vanillajs-helpers/cjs/camelCase').default;\ncamelCase('Camel cased phrase'); // camelCasedPhrase\n```\n\n```js\n// ES5 (using CommonJS Require Modules)\nconst camelCase = require('vanillajs-helpers/es5/camelCase').default;\ncamelCase('Camel cased phrase'); // camelCasedPhrase\n```\n\n## Something missing?\n\nIf you have any questions, find any bugs or have ideas for missing functionality you would like to see included, feel\nfree to add an issue in the [issue list](https://github.com/Tokimon/vanillajs-helpers/issues) or perhaps do a\n[Pull Request](https://github.com/Tokimon/vanillajs-helpers/pulls) of a great snippet you created.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokimon%2Fvanillajs-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokimon%2Fvanillajs-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokimon%2Fvanillajs-helpers/lists"}