{"id":16384782,"url":"https://github.com/saber2pr/node","last_synced_at":"2026-04-18T05:34:00.952Z","repository":{"id":57355964,"uuid":"165345676","full_name":"Saber2pr/node","owner":"Saber2pr","description":"utils for nodejs","archived":false,"fork":false,"pushed_at":"2023-12-29T07:50:31.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T18:20:16.435Z","etag":null,"topics":["async","filesystem","nodejs","promise","server","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Saber2pr.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":"2019-01-12T04:22:14.000Z","updated_at":"2023-12-29T07:44:44.000Z","dependencies_parsed_at":"2024-11-09T00:30:09.528Z","dependency_job_id":"b9f9d221-d021-4417-b27e-9a0bf73563d4","html_url":"https://github.com/Saber2pr/node","commit_stats":null,"previous_names":["saber2pr/saber-node"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saber2pr","download_url":"https://codeload.github.com/Saber2pr/node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240121607,"owners_count":19751060,"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":["async","filesystem","nodejs","promise","server","typescript"],"created_at":"2024-10-11T04:12:20.739Z","updated_at":"2026-04-18T05:34:00.921Z","avatar_url":"https://github.com/Saber2pr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @saber2pr/node\n\n\u003e utils for nodejs\n\n```bash\n# from npm\nnpm install @saber2pr/node\n\n# from github\ngit clone https://github.com/Saber2pr/node.git\n```\n\n# API\n\n## FS\n\n1. exists\n\n   \u003e `fs.exists` 的 Promise 版本\n\n2. stat\n\n   \u003e 检测一个路径是文件夹还是文件\n\n3. readdir\n\n   \u003e `fs.readdir` 的 Promise 版本\n\n4. search\n\n   \u003e 搜索目录下所有文件或所有文件夹\n\n5. readFile\n\n   \u003e `fs.readFile` 的 Promise 版本\n\n6. writeFile\n\n   \u003e `fs.writeFile` 的 Promise 版本\n\n7. mkdir\n\n   \u003e `fs.mkdir` 的 Promise 版本\n\n8. mkPath\n\n   \u003e 创建一条路径\n\n9. unlink\n\n   \u003e `fs.unlink` 的 Promise 版本\n\n10. rmdir\n\n    \u003e `fs.rmdir` 的 Promise 版本\n\n11. clearDir\n\n    \u003e 清空目录下所有文件\n\n12. remove\n\n    \u003e 删除一个目录\n\n## Terminal\n\n1. getUserInput\n\n   \u003e 终端对话交互\n\n2. getParams\n\n   \u003e 获取命令行参数\n\n## Terminal.Print\n\n1. error\n\n   \u003e 命令行输出 `警告`\n\n2. success\n\n   \u003e 命令行输出 `正确`\n\n3. tips\n\n   \u003e 命令行输出 `提示`\n\n## Http\n\n1. cookie\n\n   \u003e 把一个对象转为 `cookie` 字符串\n\n2. deCookie\n\n   \u003e 把一个 `cookie` 字符串转为对象\n\n3. query\n\n   \u003e 从 `request` 从获取参数\n\n## Http.header\n\n\u003e response 的代理\n\n## Http.Exception\n\n\u003e http 异常类，继承自`Error`\n\n1. Http.Exception.resolve\n\n\u003e 把一个 HttpException 发送 ServerResponse\n\n## start\n\n```bash\nnpm install\n```\n\n```bash\nnpm start\n\nnpm test\n\n```\n\n## develope and test\n\n\u003e you should write ts in /src\n\n\u003e you should make test in /src/test\n\n\u003e export your core in /src/index.ts!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaber2pr%2Fnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fnode/lists"}