A refactor lib.

Usage no npm install needed!

<script type="module">
  import hRefactor from 'https://cdn.skypack.dev/3h-refactor';



A refactor lib.


  • Find the reference(s) to the src file.
  • Automatically change the import/export statement(s) while moving the src file.

Support info

Here is some support info. Please note that this is the default support info, and you can customize the patterns by modifying the regular expression arrays.


The lib supports most common import/export statements out of the box.

  • import { ... } from "...";
  • import * from "...";
  • import * as ___ from "...";
  • export { ... } from "...";
  • export * from "...";
  • import ___ = require("...");
  • require("...")
  • <script src="..."></script>

File formats

Files with following extensions are included by default.

  • .js
  • .jsx
  • .mjs
  • .json
  • .ts
  • .tsx
  • .html
  • .htm


In your command line

  3h-refactor              - Show help info like this.
  3h-refactor <src>        - Show reference(s) to src file.
  3h-refactor <src> <dist> - Change src file to dist file.

In your app

Just read the declaration files in typings to learn the APIs.