
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.
nestjs-cashify
Advanced tools
Currency conversion module for nestjs framework.
npm install nestjs-cashify
Import CashifyModule
in the main module with configuration
import { CashifyModule } from 'nestjs-cashify';
const rates = {
GBP: 0.92,
EUR: 1.00,
USD: 1.12
};
@Module({
imports: [CashifyModule.forRoot({base: 'EUR', rates})],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
@Module({
imports: [
CashifyModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
base: configService.get<string>('BASE'), rates
}),
inject: [ConfigService]
})
]
})
export class AppModule {}
In order to convert currencies to each other in controllers or services, we have two approaches:
import { CashifyService } from 'nestjs-cashify';
constructor(private cashifyService: CashifyService) {
const result = this.cashifyService.convert(10, {from: 'EUR', to: 'GBP'});
console.log(result);
}
Note: Since this module is based on nodejs cashify library, in case there can be more methods added to the core library, you can inject the instance and use it as following:
import { Cashify } from 'cashify';
import { CASHIFY } from 'nestjs-cashify';
constructor(@Inject(CASHIFY) private cashify: Cashify) {
const result2 = this.cashify.convert(10, {from: 'EUR', to: 'GBP'});
console.log(result2);
}
Cashify supports parsing, so you can pass a string
to the amount
argument and the from
and/or to
currency will be automatically detected:
// Basic parsing
this.cashifyService.convert('€10 EUR', {to: 'GBP'});
// Full parsing
this.cashifyService.convert('10 EUR to GBP');
Any support is welcome. You can give the project a star, if you liked it ⭐
Feel free to contribute.
MIT
FAQs
Currency conversion module for nest
The npm package nestjs-cashify receives a total of 636 weekly downloads. As such, nestjs-cashify popularity was classified as not popular.
We found that nestjs-cashify 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.