{"id":43738310,"url":"https://github.com/eyedroot/slimphp","last_synced_at":"2026-02-05T11:09:15.416Z","repository":{"id":57363233,"uuid":"391918530","full_name":"eyedroot/slimphp","owner":"eyedroot","description":"A slim library that wraps functions used in php","archived":false,"fork":false,"pushed_at":"2021-08-30T14:20:04.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T16:25:51.913Z","etag":null,"topics":["datetime","javascript","javascript-library","nodejs","php"],"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/eyedroot.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}},"created_at":"2021-08-02T11:12:41.000Z","updated_at":"2021-08-30T14:20:02.000Z","dependencies_parsed_at":"2022-09-06T21:41:03.196Z","dependency_job_id":null,"html_url":"https://github.com/eyedroot/slimphp","commit_stats":null,"previous_names":["beaver91/slimphp","eyedroot/slimphp"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/eyedroot/slimphp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedroot%2Fslimphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedroot%2Fslimphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedroot%2Fslimphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedroot%2Fslimphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyedroot","download_url":"https://codeload.github.com/eyedroot/slimphp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedroot%2Fslimphp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29120484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["datetime","javascript","javascript-library","nodejs","php"],"created_at":"2026-02-05T11:09:14.804Z","updated_at":"2026-02-05T11:09:15.404Z","avatar_url":"https://github.com/eyedroot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slimphp\n\nA **slimphp** library that wraps functions used in **php**\n\n## Installing\nUsing npm:\n```\n$ npm install slimphp\n```\n\nUsing yarn:\n```\n$ yarn add slimphp\n```\n\n## Functions\n\n### Type Check\n- **is_array**\n  ```ts\n  import { is_array } from 'slimphp'\n\n  let result = []\n\n  if (is_array(result)) {\n    console.log('good')\n  }\n  ```\n- **is_string**\n  ```ts\n  import { is_string } from 'slimphp'\n\n  let result = 'blah blah'\n\n  if (is_string(result)) {\n    console.log('good')\n  }\n  ```\n- **is_int**\n  ```ts\n  import { is_int } from 'slimphp'\n\n  let result = 10\n\n  if (is_int(result)) {\n    console.log('good')\n  }\n  ```\n- **is_null**\n  ```ts\n  import { is_null } from 'slimphp'\n\n  let result = null\n\n  if (is_null(result)) {\n    console.log('good')\n  }\n  ```\n- **is_float**\n  ```ts\n  import { is_float } from 'slimphp'\n\n  let result = 3.14\n\n  if (is_float(result)) {\n    console.log('good')\n  }\n  ```\n- **is_undefined**\n  ```ts\n  import { is_undefined } from 'slimphp'\n\n  let result = undefined\n\n  if (is_undefined(result)) {\n    console.log('good')\n  }\n  ```\n- **is_callable**\n  ```ts\n  import { is_callable } from 'slimphp'\n\n  if (is_callable(() =\u003e {})) {\n    console.log('good')\n  }\n  ```\n\n### Array\n- **array_unique**\n  ```ts\n  import { array_unique } from 'slimphp'\n\n  let result = array_unique([1, 1, 2, 2, 3, 3])\n  console.log(result) // output: [1, 2, 3]\n  ```\n\n### Date\n- **date**\n  ```ts\n  import { date } from 'slimphp'\n\n  let result = date('Y-m-d H:i:s')\n  console.log(result) // output: 2021-08-02 21:57:45\n  ```\n- **time**\n  ```ts\n  import { time } from 'slimphp'\n\n  let result = time()\n  console.log(result) // output: 1627989888 (unixtime)\n  ```\n- **sleep**\n  ```ts\n  import { sleep } from 'slimphp'\n  \n  (async function () {\n    await sleep(5) // wait 5 seconds\n  })()\n  ```\n### String\n- **sprintf**\n  ```ts\n  import { sprintf } from 'slimphp'\n\n  const result = sprintf('Hello, %s%s', 'World', '!')\n  console.log(result) // output: Hello, World!\n  ```\n- **str_replace**\n  ```ts\n  import { str_replace } from 'slimphp'\n\n  const result1 = str_replace('Bye', 'Hello', 'Bye, World!')\n  console.log(result1) // output: Hello, World!\n\n  const result2 = str_replace(['a', 'b'], ['A', 'B'], ['a', 'b'])\n  console.log(result2) // output: ['A', 'B']\n  ```\n- **substr_replace**\n  ```ts\n  import { substr_replace } from 'slimphp'\n\n  const result1 = substr_replace('Hello, World', 'beaver', 7)\n  console.log(result1) // output: Hello, beaver\n\n  const result2 = substr_replace('Hello, World, nice!', 'beaver', 7)\n  console.log(result2) // output: Hello, beaver, nice!\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedroot%2Fslimphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyedroot%2Fslimphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedroot%2Fslimphp/lists"}