Gathering detailed insights and metrics for ts-transform-paths
Gathering detailed insights and metrics for ts-transform-paths
Gathering detailed insights and metrics for ts-transform-paths
Gathering detailed insights and metrics for ts-transform-paths
Load node modules according to tsconfig paths.
npm install ts-transform-paths
Typescript
Module System
Node Version
NPM Version
TypeScript (99.51%)
Shell (0.49%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
14 Stars
89 Commits
4 Forks
1 Watchers
2 Branches
4 Contributors
Updated on May 13, 2023
Latest Version
3.0.0
Package Id
ts-transform-paths@3.0.0
Unpacked Size
15.82 kB
Size
5.01 kB
File Count
15
NPM Version
8.19.3
Node Version
17.9.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Use this to load modules whose location is specified in the paths section of tsconfig.json.
1yarn add ts-transform-paths -D
ts-transform-paths^2.0.0 for TypeScript^2.0.0 or TypeScript^3.0.0 ts-transform-paths^3.0.0 for TypeScript^4.0.0
Unfortunately, TypeScript itself does not currently provide any easy way to use custom transformers (See https://github.com/Microsoft/TypeScript/issues/14419). The followings are the example usage of the custom transformer.
1{ 2 "compilerOptions": { 3 "paths": { 4 "@schema": ["./src/schema"], 5 "@modules/*": ["./src/modules/*"] 6 } 7 } 8}
1// webpack.config.js 2const pathsTransformer = require("ts-transform-paths").default; 3 4module.exports = { 5 // ... 6 module: { 7 rules: [ 8 { 9 test: /\.ts$/, 10 loader: "ts-loader", // or 'awesome-typescript-loader' 11 options: { 12 getCustomTransformers: (program) => pathsTransformer() 13 } 14 } 15 ] 16 } 17};
1// rollup.config.js 2import typescript from "rollup-plugin-typescript2"; 3import pathsTransformer from "ts-transform-paths"; 4 5export default { 6 // ... 7 plugins: [ 8 typescript({ 9 transformers: [ 10 (service) => pathsTransformer() 11 ] 12 }) 13 ] 14};
See ttypescript's README for how to use this with module bundlers such as webpack or Rollup.
1// tsconfig.json 2{ 3 "compilerOptions": { 4 // ... 5 "plugins": [{ "transform": "ts-transform-paths" }] 6 } 7 // ... 8}
1// my-ts-script.ts 2import { MyClass } from "@schema"; 3 4const myClass = new MyClass("Message");
1// index.js 2const pathsTransformer = require("ts-transform-paths").default; 3 4require("ts-node").register({ 5 transformers: pathsTransformer() 6}); 7 8require("./my-ts-script");
1yarn node ./index.js
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/19 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More