Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Jan 8, 2024 via pnpm

tsconfig-paths 4.1.2

Load node modules according to tsconfig paths, in run-time or via API.
Package summary
Share
0
issues
1
license
4
MIT
Package created
30 Dec 2016
Version published
1 Jan 2023
Maintainers
15
Total deps
4
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
json5@2.2.3
minimist@1.2.8
strip-bom@3.0.0
tsconfig-paths@4.1.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of tsconfig-paths 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
json52.2.349.14 kBMIT
prod
minimist1.2.815.16 kBMIT
prod
strip-bom3.0.01.7 kBMIT
prod

Visualizations

Frequently Asked Questions

What does tsconfig-paths do?

The tsconfig-paths is a helpful npm package that allows for loading of modules based on the location specified in paths section of tsconfig.json or jsconfig.json. This package enables both loading at run time and via API. Generally, TypeScript mimics the Node.js runtime resolution strategy for modules, but may have issues executing compiled files with Node or ts-node due to the path specifications in tsconfig. This is where tsconfig-paths can remedy the issue by reading the paths from tsconfig.json or jsconfig.json and converting Node's module loading calls into physical file paths that Node can understand.

How do you use tsconfig-paths?

To make use of the tsconfig-paths package, you can install it via yarn or npm by running yarn add --dev tsconfig-paths or npm install --save-dev tsconfig-paths, respectively. Once installed, you can use it with a variety of commands using the -r tsconfig-paths/register option, as in node -r tsconfig-paths/register main.js or ts-node -r tsconfig-paths/register main.ts. To setup tsconfig-paths with webpack, use the tsconfig-paths-webpack-plugin. The tsconfig-paths can also be configured with mocha and ts-node; an example of this would look like: mocha -r ts-node/register -r tsconfig-paths/register "test/**/*.ts".

For instance, to use tsconfig-paths with ts-node and VSCode, you would adjust the .vscode/launch.json configuration.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Functions",
      "request": "launch",
      "type": "node",
      "runtimeArgs": [
        "-r",
        "${workspaceFolder}/functions/node_modules/ts-node/register",
        "-r",
        "${workspaceFolder}/functions/node_modules/tsconfig-paths/register"
      ],
      "args": ["${workspaceFolder}/functions/src/index.ts"],
      "cwd": "${workspaceFolder}",
      "protocol": "inspector",
      "env": {
        "NODE_ENV": "development",
        "TS_NODE_PROJECT": "${workspaceFolder}/functions/tsconfig.json"
      },
      "outFiles": ["${workspaceFolder}/functions/lib/**/*.js"]
    }
  ]
}

Where are the tsconfig-paths docs?

Regarding documentation for tsconfig-paths, most details including installation, usage, configuration options, and more, are extensively documented in the README file in the GitHub repository of tsconfig-paths. The repository URL is https://github.com/dividab/tsconfig-paths.git. You can also take a look at API functions like register, loadConfig, createMatchPath, matchFromAbsolutePaths, createMatchPathAsync, and matchFromAbsolutePathsAsync. The repository also contains specifics on publishing details and information on built deployment operations.