{"id":22407501,"url":"https://github.com/danielhaim1/analyzeredirects","last_synced_at":"2026-02-04T06:01:53.929Z","repository":{"id":265944586,"uuid":"896949522","full_name":"danielhaim1/AnalyzeRedirects","owner":"danielhaim1","description":"A tool to analyze and resolve conflicting URL redirects.","archived":false,"fork":false,"pushed_at":"2024-12-15T22:52:25.000Z","size":519,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-02T03:22:20.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/danielhaim1.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-01T17:43:48.000Z","updated_at":"2024-12-15T22:52:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b405280-f648-4a8d-ad9e-2a128550dc88","html_url":"https://github.com/danielhaim1/AnalyzeRedirects","commit_stats":null,"previous_names":["danielhaim1/analyzeredirects"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielhaim1/AnalyzeRedirects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhaim1%2FAnalyzeRedirects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhaim1%2FAnalyzeRedirects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhaim1%2FAnalyzeRedirects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhaim1%2FAnalyzeRedirects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielhaim1","download_url":"https://codeload.github.com/danielhaim1/AnalyzeRedirects/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhaim1%2FAnalyzeRedirects/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29072460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"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":[],"created_at":"2024-12-05T11:14:36.195Z","updated_at":"2026-02-04T06:01:53.894Z","avatar_url":"https://github.com/danielhaim1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Analyze Redirects\n==========\n\n[![npm version](https://img.shields.io/npm/v/@danielhaim/analyzeredirects)](https://www.npmjs.com/package/@danielhaim/analyzeredirects)\n[![Downloads](https://img.shields.io/npm/dt/@danielhaim/analyzeredirects.svg)](https://www.npmjs.com/package/@danielhaim/analyzeredirects)\n![GitHub](https://img.shields.io/github/license/danielhaim1/analyzeredirects)\n\n![Demo Image](./demo.png)\n\nOverview\n--------\n\n`AnalyzeRedirects` is a tool for analyzing URL redirects, identifying duplicates and conflicts, and generating `.htaccess` or `.nginx` style redirect rules.\n\nInstallation\n------------\n\nInstall `AnalyzeRedirects` using NPM:\n\n```shell\nnpm i @danielhaim/analyzeredirects\n```\n\n2. Link the Package Locally\nIf you're working on the project locally and want to test your changes in your environment, use `npm link`:\n\n```shell\nnpm link\n```\n\n3. Linking in another project\nIf you want to link this package into another project for testing or development, you can use this command inside the target project:\n\n```shell\nnpm link @danielhaim/analyzeredirects\n```\n\n### API Documentation ###\nOnce installed, you can use the command-line interface (CLI) to analyze your redirects and generate `.txt` files with the rules. Here's how to use it:\n\n```bash\n# If you have linked the package locally:\nanalyze-redirects --file \u003cpath_to_your_json_file\u003e [options]\n\n# If you installed the package normally:\nnpx analyze-redirects --file \u003cpath_to_your_json_file\u003e [options]\n```\n\n### Options:\n- `-f`, `--file \u003cpath\u003e`: Path to JSON file with Old_URL and New_URL.\n- `-o`, `--output \u003cpath\u003e`: Path to output the generated redirects file (default: `./dist/redirects.txt`).\n- `-a`, `--analyze-only`: Only analyze redirects without generating output file.\n- `-s`, `--silent`: Suppress console output.\n- `-h`, `--help`: Display this help message.\n\n### Examples:\n\nTo analyze redirects and see the output in the console:\n\n```bash\nanalyze-redirects --file ./__test__/demo-urls.json\n```\n\nTo generate a file with the redirects:\n\n```bash\nanalyze-redirects -f ./__test__/demo-urls.json -o ./output-redirects.txt\n```\n\nTo analyze without generating a file:\n\n```bash\nanalyze-redirects --file ./__test__/demo-urls.json --analyze-only\n```\n\n### Adding a New URL Set\n\nTo add a new set of redirects, create a urls.json file in the ./sets/ directory with the following structure:\n```json\n[\n    { \"Old_URL\": \"/old-page\", \"New_URL\": \"https://example.com/new-page\" },\n    { \"Old_URL\": \"/another-page\", \"New_URL\": \"https://example.com/another-page\" }\n]\n```\n\nOnce your set is added, you can analyze it using the CLI by specifying the path to your `urls.json` file.\n\nLicense\n-------\n\nThis software is released under the [MIT License](LICENSE)\n\nReport Issues or Request a Feature\n----------------------------------\n\nIf you encounter any issues or have suggestions for improvements, please feel free to report them. Your feedback is invaluable in enhancing this software.\n\nFolder Structure\n----------------\n\nHere's an overview of the project's folder structure:\n\n```bash\n.\n├── LICENSE\n├── README.md\n├── __test__\n│   ├── analyzeredirects.test.js\n│   ├── demo-redirects.txt\n│   ├── demo-urls.json\n│   └── expected-demo-redirects.txt\n├── babel.config.js\n├── cli.js\n├── index.js\n├── jest.config.mjs\n├── package-lock.json\n├── package.json\n├── sets\n│   └── urls.json\n└── src\n    ├── index.js\n    └── util.analyze.js\n```\n\n- `__test__`: Contains test files and sample data.\n- `cli.js`: The CLI entry point.\n- `sets/urls.json`: Default set for analysis, you can add your own sets here.\n- `src/`: Source code for redirect analysis and utilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielhaim1%2Fanalyzeredirects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielhaim1%2Fanalyzeredirects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielhaim1%2Fanalyzeredirects/lists"}