{"id":19511283,"url":"https://github.com/jornatf/helpers-ts","last_synced_at":"2026-04-12T03:38:39.800Z","repository":{"id":161369888,"uuid":"635662100","full_name":"jornatf/helpers-ts","owner":"jornatf","description":"Some simple Helpers to manipulate strings and arrays for JavaScript and Typescript.","archived":false,"fork":false,"pushed_at":"2023-11-29T21:23:16.000Z","size":37,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T10:45:32.948Z","etag":null,"topics":["framework","helpers","javascript","library","nodejs","npm","npm-registry","package","typescript","utils"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/helpers-ts","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/jornatf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2023-05-03T07:23:10.000Z","updated_at":"2023-11-29T11:04:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"fbd0872a-2cc8-4eff-9aea-276745153f52","html_url":"https://github.com/jornatf/helpers-ts","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jornatf/helpers-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fhelpers-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fhelpers-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fhelpers-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fhelpers-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jornatf","download_url":"https://codeload.github.com/jornatf/helpers-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jornatf%2Fhelpers-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31703501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"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":["framework","helpers","javascript","library","nodejs","npm","npm-registry","package","typescript","utils"],"created_at":"2024-11-10T23:20:11.950Z","updated_at":"2026-04-12T03:38:39.782Z","avatar_url":"https://github.com/jornatf.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/jornatf"],"categories":[],"sub_categories":[],"readme":"# helpers-ts\n\n![Latest Version](https://img.shields.io/github/v/tag/jornatf/helpers-ts?label=version\u0026style=flat-square)\n[![Licence](https://img.shields.io/github/license/jornatf/helpers-ts?label=license\u0026style=flat-square)](LICENCE.md)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/jornatf/helpers-ts/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/jornatf/helpers-ts/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Prettier Action Status](https://img.shields.io/github/actions/workflow/status/jornatf/helpers-ts/fix-styling-code.yml?branch=main\u0026label=code+style\u0026style=flat-square)](https://github.com/jornatf/helpers-ts/actions?query=workflow%3Afix-styling-code+branch%3Amain)\n\n[![Downloads](https://img.shields.io/npm/dt/helpers-ts?label=downloads\u0026style=flat-square)](https://www.npmjs.com/package/helpers-ts)\n\n**Some simple Helpers to manipulate strings and arrays for JavaScript and Typescript.**\n\n\u003e #### If you like this package you can [Buy me a Coffee](https://www.buymeacoffee.com/jornatf) ☕️\n\n#### Table of contents\n\n-   [Installation](#introduction)\n-   [Usage](#usage)\n    -   [Strings](#strings)\n    -   [Arrays](#arrays)\n    -   [Numbers](#numbers)\n-   [Changelog](#changelog)\n-   [Contributing](#contributing)\n-   [Credits](#credits)\n-   [License](#license)\n\n## Installation\n\n```bash\n# To install this package, run:\n$ npm install helpers-ts\n# or\n$ npm i helpers-ts\n```\n\n## Usage\n\n\u003e This package is intended to help you manipulate strings and arrays, in JavaScript and Typescript. It is available from the **[NPM Registry](https://www.npmjs.com/package/helpers-ts)**.\n\n```javascript\nimport { toCamel } from 'helpers-ts'\n\nconst str = 'Hello world'\nconsole.log(toCamel(str))\n\n// Output: 'helloWorld'\n```\n\n### Strings\n\n#### `slugify()`\n\nConverts a string into slug.\n\n```javascript\nslugify('Hello world') // 'hello_world'\nslugify('Hello world', '-') // 'hello-world'\n```\n\n#### `toCamel()`\n\nConverts a string into camelCase.\n\n```javascript\ntoCamel('Hello world') // 'helloWorld'\n```\n\n#### `toPascal()`\n\nConverts a string into PascalCase.\n\n```javascript\nslugify('Hello world') // 'HelloWorld'\n```\n\n#### `isUuid()`\n\nChecks if a string is a valid uuid.\n\n```javascript\nisUuid('5c5a300f-20fb-416f-b026-6f53f8bdc7f5') // true\nisUuid('not-uuid') // false\n```\n\n#### `uuid()`\n\nReturns a random and unique Uuid.\n\n```javascript\nuuid() // '5c5a300f-20fb-416f-b026-6f53f8bdc7f5'\n```\n\n#### `limitStr()`\n\nLimits a string to a specified number of characters.\n\n```javascript\nlimitStr('This is a long string that needs to be limited.', 20)\n// 'This is a long strin...'\n```\n\n#### `randomStr()`\n\nReturns a random string with a specified number of characters.\n\n```javascript\nrandomStr(6) // 'ab12c3'\n```\n\n#### `replaceStr()`\n\nReplaces occurrences of a string by another.\n\n```javascript\nreplaceStr('world', 'earth', 'Hello world') // 'Hello earth'\n```\n\n#### `squish()`\n\nTrims and removes extra spaces between words with a specified number of space.\n\n```javascript\nsquish(' Hello     world ', 5) // 'Hello world'\n```\n\n#### `contains()`\n\nChecks if a word is in a string.\n\n```javascript\ncontains('world', 'Hello world') // true\ncontains('earth', 'Hello world') // false\n```\n\n#### `containsAll()`\n\nCheck if many words are in a string.\n\n```javascript\ncontainsAll(['string', 'test'], 'This is a string to test.') // true\ncontainsAll(['number', 'test'], 'This is a string to test.') // false\n```\n\n### Arrays\n\n#### `crossJoin()`\n\nJoins arrays and returns all possible combinations of input arrays.\n\n\u003e You can pass more than 2 arrays.\n\n```javascript\ncrossJoin(['red', 'green'], ['small', 'medium'])\n// [['red', 'small'], ['red','medium'], ['green', 'small'], ['green','medium']]\n```\n\n#### `keyExists()`\n\nChecks if a key exists in an array.\n\n```javascript\nkeyExists('foo', ['foo', 'bar', 'baz']) // true\nkeyExists('qux', ['foo', 'bar', 'baz']) // false\n\nkeyExists('foo', { foo: 'bar', baz: 'qux' }) // true\n```\n\n#### `firstKey()`, `lastKey()`\n\nReturns first or last key.\n\n```javascript\nfirstKey(['foo', 'bar', 'baz']) // 'foo'\nlastKey(['foo', 'bar', 'baz']) // 'baz'\n```\n\n#### `implode()`\n\nConverts an array into string.\n\n```javascript\nimplode(['Foo', 'Bar']) // 'Foo Bar'\nimplode(['Foo', 'Bar'], ', ') // 'Foo, Bar'\n```\n\n#### `explode()`\n\nConverts a string into array.\n\n```javascript\nexplode('Foo,Bar') // ['Foo', 'Bar']\nimplode('Foo Bar', ' ') // ['Foo', 'Bar']\n```\n\n#### `isEmpty()`\n\nChecks if an array is empty.\n\n```javascript\nisEmpty([]) // true\nisEmpty([1, 2, 3]) // false\n```\n\n#### `shuffle()`\n\nShuffles array keys.\n\n```javascript\nshuffle([1, 2, 3, 4]) // [3, 1, 4, 2]\n```\n\n### Numbers\n\n#### `randBetween()`\n\nReturns a random number between `min` and `max`.\n\n```javascript\nrandBetween(5, 10) // 8\n```\n\n## Changelog\n\n\u003e Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\n\u003e If you are interested in this project and want to improve it, fix errors or bugs, **you're welcome to contribute**.\n\u003e\n\u003e [![Contributors](https://img.shields.io/github/contributors/jornatf/helpers-ts?style=flat-square)](../../contributors)\n\n## Credits\n\n-   [Jordan Nataf](https://github.com/jornatf)\n-   [All Contributors](../../contributors)\n\n## Licence\n\nThe MIT License (MIT).\n\n\u003e Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjornatf%2Fhelpers-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjornatf%2Fhelpers-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjornatf%2Fhelpers-ts/lists"}