{"id":13532391,"url":"https://github.com/bluedaniel/js-codemod-import-absolute","last_synced_at":"2025-12-30T05:18:13.502Z","repository":{"id":136844842,"uuid":"97210674","full_name":"bluedaniel/js-codemod-import-absolute","owner":"bluedaniel","description":":art: Codemod to replace relative imports with absolute or custom paths","archived":false,"fork":false,"pushed_at":"2022-11-18T21:17:51.000Z","size":57,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2024-11-02T19:34:11.399Z","etag":null,"topics":["codemod","jscodeshift"],"latest_commit_sha":null,"homepage":"","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/bluedaniel.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":"2017-07-14T08:18:26.000Z","updated_at":"2021-11-01T06:06:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbad3a37-5c12-4d2d-8062-158db2751436","html_url":"https://github.com/bluedaniel/js-codemod-import-absolute","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedaniel%2Fjs-codemod-import-absolute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedaniel%2Fjs-codemod-import-absolute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedaniel%2Fjs-codemod-import-absolute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedaniel%2Fjs-codemod-import-absolute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluedaniel","download_url":"https://codeload.github.com/bluedaniel/js-codemod-import-absolute/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709923,"owners_count":20821297,"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":["codemod","jscodeshift"],"created_at":"2024-08-01T07:01:10.643Z","updated_at":"2025-12-30T05:18:13.497Z","avatar_url":"https://github.com/bluedaniel.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# JS Codemod Import Absolute\n\nCodemod to replace `[\"parent\", \"sibling\", \"index\"]` imports with absolute or custom paths.\n\nIt can also sort according to the `eslint-plugin-import` [order rule](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md).\n\n*Note*: Use the -d option for a dry-run and use -p to print the output for comparison.\n\n```javascript\n// /Users/bluedaniel/Sites/test/index.js\nimport bar from './bar';\nimport _ from 'lodash';\nimport baz from './bar/baz';\nimport chalk from 'chalk';\nimport foo from '../foo';\nimport foo from 'src/foo';\nimport fs from 'fs';\nimport main from './';\nimport path from 'path';\nimport qux from '../../foo/qux';\n\n// jscodeshift -t import-absolute.js \u003cfile\u003e\nimport fs from 'fs';\nimport path from 'path';\nimport chalk from 'chalk';\nimport _ from 'lodash';\nimport foo from 'src/foo';\nimport qux from \"/Users/bluedaniel/foo/qux\";\nimport foo from \"/Users/bluedaniel/Sites/foo\";\nimport bar from \"/Users/bluedaniel/Sites/test/bar\";\nimport baz from \"/Users/bluedaniel/Sites/test/bar/baz\";\nimport main from \"/Users/bluedaniel/Sites/test\";\n```\n\n## Installing\n\n```shell\n$ git clone https://github.com/bluedaniel/js-codemod-import-absolute.git\n$ cd js-codemod-import-absolute\n$ npm i\n```\n\n## Options (All are optional)\n\n```\n--absolutePath\nReplaces your current directory to a string of your choosing\n\n--replace\nReplace any string in the new path\n\n--replaceWith [default '']\nReplaces any occurrences of the string specified in `--replace`. Default is ''\n\n--sort [default true]\nSorts imports according to `eslint-plugin-import` order rule\nhttps://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedaniel%2Fjs-codemod-import-absolute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluedaniel%2Fjs-codemod-import-absolute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedaniel%2Fjs-codemod-import-absolute/lists"}