Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
aliases-from-tsconfig
Advanced tools
Readme
tsconfig.json
Reads a jsconfig/tsconfig.json baseUrl and paths and provides a method to replace its aliases in your files paths.
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install aliases-from-tsconfig --save
# For Yarn, use the command below.
yarn add aliases-from-tsconfig
Create an AliasesFromTSConfig
instance with the path to your jsconfig/tsconfig.json, and use its methods to check if the file's path has an alias or to apply the alias.
import AliasesFromTSConfig from 'aliases-from-tsconfig';
const aliases = new AliasesFromTSConfig('./tsconfig.json');
aliases.apply('@/components/Button/ButtonGhost.js');
//=> './app/assets/components/Button/ButtonGhost.js'
function processFilePath(path) {
if (aliases.hasAlias(path)) {
console.log(`The file path "${path}" has an alias from tsconfig.json.`);
}
return aliases.apply(path);
}
Create an instance of AliasesFromTSConfig
using the path to your tsconfig.json
as argument, and then call the method getAliasesForWebpack
to get the correct alias configuration for webpack.
// configuration/webpack.config.mjs
import AliasesFromTSConfig from 'aliases-from-tsconfig';
const aliases = new AliasesFromTSConfig('../jsconfig.json');
export default {
resolve: {
alias: aliases.getAliasesForWebpack(),
// ...
},
// ...
};
Documentation generated from source files by Typedoc.
Released under MIT License.
FAQs
Reads a jsconfig/tsconfig.json baseUrl and paths and provides a methods to replace its aliases in your files paths.
The npm package aliases-from-tsconfig receives a total of 121 weekly downloads. As such, aliases-from-tsconfig popularity was classified as not popular.
We found that aliases-from-tsconfig demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.