
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
mycrypto-path-alias-resolver
Advanced tools
Resolve aliases in ts files. Useful for when you want to publish a package with the typings
file in package.json
, as a project consuming your package will not respect your package's baseurl and path mappings. This will convert all path mappings to relative paths.
npm i -D mycrypto-path-alias-resolver
Due to the nature of the regex used to resolve multi-line imports, it currently has the limitation of only working with prettier
and the follow configuration file:
{
"printWidth": 80,
"singleQuote": true,
"useTabs": false,
"semi": true,
"tabWidth": 2,
"trailingComma": "all"
}
Also, support for resolving aliased exports such as export * from '@src/ethUnits';
is not implemented
Let's say you have a project that has its source files in <rootDir>/src
, and you want to ignore any *.spec.ts
or *.test.ts
files.
{
"compilerOptions": {
"outDir": "dist",
"target": "es2017",
"sourceMap": true,
"module": "es2015",
"baseUrl": "./",
"lib": ["es2017", "dom"],
"allowSyntheticDefaultImports": true,
"paths": {
"@src*": ["src*"],
"@test*": ["__test__*"]
},
"moduleResolution": "node",
"noEmitOnError": false,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noFallthroughCasesInSwitch": true,
"noImplicitThis": true,
"pretty": true
},
"include": ["./src/", "./__test__/"]
}
├── coverage
├── dist
├── docs
├── gulpfile.js
├── node_modules
├── package.json
├── package-lock.json
├── readme.md
├── rollup.config.ts
├── src
├── __test__
├── tsconfig-build.json
├── tsconfig.json
└── tslint.json
gulpfile.js
to use with above setupconst gulp = require('gulp');
const alias = require('path-alias-resolver/gulp');
gulp.task('default', () => {
return gulp
.src(['./src/**/*.ts', '!./src/**/*.spec.ts', '!./src/**/*.test.ts'])
.pipe(alias('.', { '@src': './src' }))
.pipe(gulp.dest('./dist/lib'));
});
['./src/**/*.ts', '!./src/**/*.spec.ts', '!./src/**/*.test.ts']
Ignore any *.spec.ts
or *.test.ts
files while including all other .ts
files in src
alias('.', { '@src': './src' })
The first parameter corresponds to your baseUrl
setting in tsconfig.json
.
The second parameter is an object of mappings from the paths
key in tsconfig.json
to its value.
gulp.dest('./dist/lib')
Pass the resulting transformed files to ./dist/list
FAQs
Resolve aliases in ts files
We found that mycrypto-path-alias-resolver demonstrated a not healthy version release cadence and project activity because the last version was released 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.