{"id":20172334,"url":"https://github.com/akinozgen/alternatives","last_synced_at":"2026-05-09T02:03:56.212Z","repository":{"id":133329538,"uuid":"152081335","full_name":"akinozgen/alternatives","owner":"akinozgen","description":"Some alternative implementations for common interfaces, classes etc.","archived":false,"fork":false,"pushed_at":"2018-11-23T16:38:55.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T11:13:00.591Z","etag":null,"topics":["alternative","definition","es6","functional-programming","javascript","json","react"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akinozgen.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-10-08T13:05:51.000Z","updated_at":"2023-11-20T08:14:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"29ca45fc-fae9-4113-914b-6b8c656a6671","html_url":"https://github.com/akinozgen/alternatives","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinozgen%2Falternatives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinozgen%2Falternatives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinozgen%2Falternatives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinozgen%2Falternatives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akinozgen","download_url":"https://codeload.github.com/akinozgen/alternatives/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241607732,"owners_count":19989953,"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":["alternative","definition","es6","functional-programming","javascript","json","react"],"created_at":"2024-11-14T01:29:42.164Z","updated_at":"2025-10-12T14:41:14.126Z","avatar_url":"https://github.com/akinozgen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alternatives\nSome alternative implementations for common interfaces, classes etc.\n\n1. ### React Native AsyncStorage Alternative\n\n[goto file](https://github.com/akinozgen/alternatives/blob/master/asyncstorage-alt.js)\n\nData reading usage:\n```javascript\nimport { getItem, setItem } from 'asyncstorage-alt';\n\nasync function readData() {\n  const values = {};\n  \n  values['get_via_array'] = await getItem(['id', 'name', 'email']);\n  values['get_directly'] = await getItem('id');\n  console.log(values);\n}\n\n```\nOutput:\n\n```json\n{\n  \"get_via_array\": {\n    \"id\": 1,\n    \"name\": \"Akın Özgen\",\n    \"email\": \"akinozgen17@outlook.com\"\n  },\n  \"get_directly\": 1\n}\n```\n\nData writing usage:\n```javascript\nimport { getItem, setItem } from 'asyncstorage-alt';\n\nasync function writeData() {\n  // Multi definition\n  await setItem({ id: 1, name: 'Akın Özgen', email: 'akinozgen17@outlook.com' });\n  // Single definition\n  await setItem('id', 1);\n}\n```\n\n2. ### php's http_build_query for key-value pair objects\n\n[goto file](https://github.com/akinozgen/alternatives/blob/master/http_build_query.js)\n\n```javascript\nimport http_build_query from 'http_build_query';\n\nconst loginPayload = {\n  username: 'root',\n  password: 'toor'\n};\n\nconsole.log(http_build_query(loginPayload));\n```\nOutput:\n\n```raw\nusername=root\u0026password=toor\n```\n\n3. ### NodeList to Array\n\n[goto file](https://github.com/akinozgen/alternatives/blob/master/nodelist_to_array.js)\n\n```javascript\nimport n2a from 'nodelist_to_array.js';\n\nconst rows = document.querySelectorAll('tr');\n\nconsole.log(n2a(rows));\n```\n\n4. ### Insister \u003csmall\u003e(really annoying)\u003c/small\u003e\n\n[goto file](https://github.com/akinozgen/alternatives/blob/master/insister.js)\n\n```javascript\nimport ins from 'insister.js';\n\n// Parameters:\n//  (ins): insister (which is this function)\n//  (_ =\u003e prompt(\"Accept?\") !== \"yes\"): condition (if returns false, function repeats itself)\n//  (_ =\u003e alert(\"Thanks\")): callback (runs if condtion is true)\n\nins(ins, _ =\u003e prompt(\"Accept?\") !== \"yes\", _ =\u003e alert(\"Thanks\"));\n\n```\n\n4. ### String mask with *** (php)\n\n[goto file](https://github.com/akinozgen/alternatives/blob/master/string-mask-php.php)\n\n```php\n\n/**\n * asteriskMask($string: string, $length: number, $beginning: bool);\n *\n */\nrequire_once 'string-mask-php.php';\n\n$myUnprotectedPhoneNumber = '+90 588 4777 777 777 44';\n\necho asteriskMask($myUnprotectedPhoneNumber, 3) . \"\\n\";\necho asteriskMask($myUnprotectedPhoneNumber, 5, true) . \"\\n\";\necho asteriskMask('root', 5); // If length greater than strlen('root') new length is strlen('root') / 2\n\n// Output: +90 588 4777 777 77***\n//         *****88 4777 777 77 44\n//         ro**\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakinozgen%2Falternatives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakinozgen%2Falternatives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakinozgen%2Falternatives/lists"}