Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aliasify-imports

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aliasify-imports

A codemod that swaps relative imports for aliases — your go-to buddy for project refactoring!

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-91.67%
Maintainers
0
Weekly downloads
 
Created
Source

aliasify-imports · license

A codemod that swaps relative imports for aliases — your go-to buddy for project refactoring!

Installation

npm install -g aliasify-imports

Usage

Run the transformation on your source directory:

aliasify-imports --srcDir src --alias @

CLI Options

  • --alias (Default: @) - The alias to use for the import paths.
  • --srcDir (Default: src) - The source directory to use for the alias.
  • --parser (Default: 'tsx') - The parser to use
  • --extensions (Default: 'js,jsx,ts,tsx') - The file extensions to transform
  • --help - Display the help message

Example

Before

// In src/components/Header/index.js

import Logo from '../../assets/images/logo.png';
import Utils from '../../../utils/helpers';
import Footer from '../Footer';

After

// In src/components/Header/index.js

import Logo from '@/assets/images/logo.png';
import Utils from '@/utils/helpers';
import Footer from '@/components/Footer';

License

MIT

Keywords

FAQs

Package last updated on 13 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc