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

convert-root-import

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-root-import - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "convert-root-import",
"version": "1.0.1",
"version": "1.0.2",
"description": "Convert paths used in babel-plugin-root-import to relative ones",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,15 @@ # `convert-root-import`

## Usage
```
convert-root-import -o some-file.js`
```
See `convert-root-import --help` for more information.
As this tool currently works on single files at a time, you would drive it using `find` or similar if you want to change hundreds of files:
```
# change JSX files
find src/client -name '*.jsx' -exec convert-root-import -o {} \;`
```
## Caveats

@@ -20,1 +33,10 @@ This is a simple tool that doesn't build an AST, and only works line-wise. As such, it does not handle multi-line

```
## Contribute?
PRs are welcome :-) This tool was hacked together in a few hours, and does the job in the 95% case for me.
Possible improvements:
- handle multi-line imports
- traversing directories and multi-file handling (would make `find` superflous)
- building ASTs to handle complex cases?
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