1.5.1 • Published 12 months ago

typescript-paths v1.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

typescript-paths

Latest Version

Resolving tsconfig paths in runtime

npm install typescript-paths
const { register } = require("typescript-paths")
register()

Example tsconfig.json

{
  "compilerOptions": {
    "paths": {
      "~/*": ["./*"]
    }
  }
}

Then you can import alias instead of annoying path

// const App = require("../../../../App")
const App = require("~/App")

Options

tsConfigPath (string | string[])

Specify the path where your TypeScript configuration file.

If not set:

  • use Environment variable TS_NODE_PROJECT
  • or search tsconfig.json in current working directory.

logLevel ("none" | "error" | "warn" | "info" | "debug" | "trace") (default: "info")

Set the logging level on the plugin.

fallback (function (string): string | undefined)

The handler to handle unusual module name.

color (boolean) (default: true)

Colorful ouput.

respectCoreModule (boolean) (default: true)

reference

1.5.1

12 months ago

1.5.0

1 year ago

1.4.0

2 years ago

1.2.0

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago