{"id":17984047,"url":"https://github.com/suryapratapsinghsuryavanshi/rectify-name","last_synced_at":"2026-05-01T13:32:31.891Z","repository":{"id":44878070,"uuid":"450208707","full_name":"suryapratapsinghsuryavanshi/rectify-name","owner":"suryapratapsinghsuryavanshi","description":"A simple npm package rectifies all file names according to provided case extension.","archived":false,"fork":false,"pushed_at":"2022-07-18T11:18:40.000Z","size":675,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-19T01:56:41.296Z","etag":null,"topics":["cli","cli-tool","npm","npm-cli","npm-module","npm-package","rectify-name","utility-application"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rectify-name","language":"JavaScript","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/suryapratapsinghsuryavanshi.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":"2022-01-20T18:15:23.000Z","updated_at":"2022-07-18T11:08:07.000Z","dependencies_parsed_at":"2022-09-09T20:32:00.366Z","dependency_job_id":null,"html_url":"https://github.com/suryapratapsinghsuryavanshi/rectify-name","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/suryapratapsinghsuryavanshi/rectify-name","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryapratapsinghsuryavanshi%2Frectify-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryapratapsinghsuryavanshi%2Frectify-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryapratapsinghsuryavanshi%2Frectify-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryapratapsinghsuryavanshi%2Frectify-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suryapratapsinghsuryavanshi","download_url":"https://codeload.github.com/suryapratapsinghsuryavanshi/rectify-name/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suryapratapsinghsuryavanshi%2Frectify-name/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32499681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["cli","cli-tool","npm","npm-cli","npm-module","npm-package","rectify-name","utility-application"],"created_at":"2024-10-29T18:19:18.614Z","updated_at":"2026-05-01T13:32:31.833Z","avatar_url":"https://github.com/suryapratapsinghsuryavanshi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](./static/logo.gif)\nA simple npm package rectifies all file names according to provided case extension.\n\n### 📥 Rectify files with the help of npx\n```sh\nnpx rectify-name help\n# or\nnpx rectify-name \u003coptions\u003e [args]\n```\n\n### 📦 Install with the help of npm or yarn\n```sh\n# Use -g or global if you want to be install package as a CLI package.\nnpm install -g rectify-name\n# or\nyarn global add rectify-name\n```\n\n\u003cbr/\u003e\n\n## 📑 Use as a CLI Package\nThe options and args provided by the rectify-name package are below mentioned.\n| Options(flags) | Supported args `default` | Options Description |\n| - | - | - |\n| -d, --directory | directory-path as string `\"./\"` | Rectify given directory files, if a directory exists. | \n| -c, --case | [case-type](#📔-case-type) `\"lower-case\"` | Rectify pwd files to a given case-type. |\n| --caps |  | Apply capitalization, if case-type is supported. |\n| -h, --help, help |  | Get help manual |\n| -v, --version, version |  | Get the current package version |\n\n#### 🧪 CLI Example\n```sh\nrectify-name -d \"./test\" -c \"camel-case\" --caps\n```\nIn the above example is an option `-d` to set the directory path, `-c` is used to set the case-type and last option --caps is said to capitalize the camelCase type to CamelCase.\n\n### 📔 case-type\nBelow case-type will be supported by the rectify-name package, as the case-type args.\n\n| case-type | Support capitalization | Example | Capitalization |\n| - | - | - | - |\n| lower-case | | \"my file.txt\", \"test file.txt\" | |\n| camle-case | YES | \"myFile.txt\", \"testFile.txt\" | \"MyFile.txt\", \"TestFile.txt\" |\n| capital-case | | \"My File.txt\", \"Test File.txt\" | |\n| constant-case | | \"MY_FILE.txt\", \"TEST_FILE.txt\" | |\n| kebab-case | YES | \"my-file.txt\", \"test-file.txt\" | \"My-File.txt\", \"Test-File.txt\" |\n| pascal-case | | \"MyFile.txt\", \"TestFile.txt\" | |\n| snake-case | YES | \"my_file.txt\", \"test_file.txt\" | \"My_File.txt\", \"Test_File.txt\" |\n\n\u003cbr/\u003e\n\n## 📄 Use as a Package Dependency\nThis package is also capable to use as a dependency package with the help of importing two method.\n\n```js\n// CommonJS\nconst { renameFile, reflectRenameOnSystem } = require(\"rectify-name\");\n\n// ES6\nimport { renameFile, reflectRenameOnSystem } from \"rectify-name\";\n```\n\n### 📝 renameFile\nThe renameFile method takes two parameters, the first is the options object and the second is the file name array. and returns an object with the actual filename and the changed filename.\n\n```js\n// dir: name of the directory.\n// case: according to the case type table refer to the case-type.\n// caps: if the case is supported, then capitalization will work.\nconst defaultOptions = { dir: './', case: 'lower-case', caps: false };\n\n/* File name array you will get your file name to \nan array with the help of readdir or readdirSync \nmethod in the fs module in NodeJs. */\nconst fileNameArray = [\n\t'blog-1.txt',\n\t'blog_2.txt',\n\t'camelCase.txt',\n\t'Capital Case.txt',\n\t'CONSTANT_CASE.txt',\n\t'details file me.js',\n\t'PascalCase.txt'\n];\nconst actualAndRenamedFiles = renameFile(defaultOptions, fileNameArray);\n```\n\n### 🗃️ reflectRenameOnSystem\nAs the name suggests this method will apply to rename files on the system, and it will rename the provided directory files, first argument of this method is the directory path.\n```js\n// The response provided by the renameFile method is used as the second argument of this method.\nconst actualAndRenamedFiles = renameFile(defaultOptions, fileNameArray);\n\n// This method does not return anything, you can see the output on the provided path.\nreflectRenameOnSystem(\"./\", actualAndRenamedFiles);\n```\n\u003chr\u003e\n\n### Thanks 💻\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuryapratapsinghsuryavanshi%2Frectify-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuryapratapsinghsuryavanshi%2Frectify-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuryapratapsinghsuryavanshi%2Frectify-name/lists"}