{"id":17380201,"url":"https://github.com/ulivz/supath","last_synced_at":"2026-04-18T01:03:54.394Z","repository":{"id":57374543,"uuid":"85341444","full_name":"ulivz/supath","owner":"ulivz","description":"An additional path parsing module for nodejs","archived":false,"fork":false,"pushed_at":"2019-07-30T16:36:20.000Z","size":17,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-30T09:29:27.299Z","etag":null,"topics":["nodejs","npm","parser","path","path-parsing"],"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/ulivz.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}},"created_at":"2017-03-17T18:07:48.000Z","updated_at":"2022-02-16T04:45:13.000Z","dependencies_parsed_at":"2022-08-27T12:12:01.570Z","dependency_job_id":null,"html_url":"https://github.com/ulivz/supath","commit_stats":null,"previous_names":["toxichl/supath"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ulivz/supath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulivz%2Fsupath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulivz%2Fsupath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulivz%2Fsupath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulivz%2Fsupath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulivz","download_url":"https://codeload.github.com/ulivz/supath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulivz%2Fsupath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31952208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"ssl_error","status_checked_at":"2026-04-18T00:39:20.671Z","response_time":62,"last_error":"SSL_read: 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":["nodejs","npm","parser","path","path-parsing"],"created_at":"2024-10-16T06:41:46.021Z","updated_at":"2026-04-18T01:03:54.372Z","avatar_url":"https://github.com/ulivz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# supath\n[![Travis branch](https://img.shields.io/travis/rust-lang/rust/master.svg)]()\n[![npm](https://img.shields.io/npm/dm/localeval.svg)]()\n[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)]()\n\nAn additional path parsing module for nodejs\n\n# Qucik Start\n\ninstallation:\n\n```\n$ npm install supath --save-dev\n```\n\nIntroduced in the project:\n\n```js\nvar supath = require('supath')\n\nvar aPath = './config/global/global-config.ts'\n\nvar result = supath.parse(aPath)\n```\n\n`result` will get the following values:\n```json\n{\n  \"fileCheck\": true,\n  \"dirCheck\": false,\n  \"base\": \"global-config.ts\",\n  \"file\": \"global-config\",\n  \"dotSuffix\": \".ts\",\n  \"suffix\": \"ts\",\n  \"dir\": \"./config/global/\",\n  \"fullPath\": \"./config/global/global-config.ts\"\n}\n```\n\nMore api please continue to look down.\n\n# API\n\n## supath.checkFileName(fileName)\n- ParamType: `String`\n- Description: `Check if a file name is valid`\n\n## supath.getPathSep(path)\n- Type: `String`\n- Description: `Gets a delimiter for a path`\n\nThis method is not used to get the system's delimiter\nand Returns `undefined` if the path contains `/` or both`\\`\n\n\n## supath.isFilePath(path)\n- ParamType: `String`\n- Description: `detect whether a string meets the requirements of the [directory] path`\n\nthis method differs from `fs.statSync(path).isFile()`\nPath checking does not require that the file or  pointed to must exist\nJust used to verify the legitimacy of the path\n\nThe following example will return `true`:\n\n```markdown\nhttp://tool.chinaz.com/regex/toxichl.html\nC:\\Program Files\\ASUS\\AMDA\\AXSP\\ATKEX.dll\n```\n\n\n\n## supath.isDirPath(path)\n- ParamType: `String`\n- Description: `detect whether a string meets the requirements of the [directory] path`\n\n\nThe following example will return `true`:\n\n```markdown\n- http://tool.chinaz.com/regex.\n- http://tool.chinaz.com/regex/\n- http://tool.chinaz.com/regex\n```\n\n\n## supath.parse(path)\n- ParamType: `String`\n- Description: `Returns the various details of a path`\n\nthe description of the Returning object:\n\nkey|desc\n---|---\nfileCheck|Whether it is a `file` path\ndirCheck|Whether it is a `directory` path\nbase| `File name + '.' + Suffix name` (eg: `index.html`)\nfile| `File name` (eg: `index`)\ndotSuffix| `'.' + Suffix name` (eg: `.html`)\nsuffix| `Suffix name` (eg: `html`)\ndir| `Directory name` (eg: `http://tool.chinaz.com/regex/`)\nfullPath| `The original path`\n\n\n## supath.standardDir(path, flag)\n- ParamType: `(String, Boolean)`\n- Description: `Directory path normalization - directory path ends with '/' or no '\\`\n\nThe default value of `flag` is `true`, For the role of flag, please see the table below\n\nflag|desc\n---|---\ntrue|returns the path string with `\\` at the end\nfalse|return to the end of the path string without `\\`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulivz%2Fsupath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulivz%2Fsupath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulivz%2Fsupath/lists"}