
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
shopify-currencies.js
Advanced tools
Simple wrapper to access Shopify's currency conversion rates from Node.js
This package provides a simple wrapper to access Shopify's currency conversion rates from Node.js.
npm install shopify-currencies.js
import { loadCurrencies } from 'shopify-currencies.js';
const currencies = await loadCurrencies();
// Conversion rates for EUR
console.log(`Conversion rates for EUR: ${currencies.rates.EUR}`);
// Convert 1 USD to EUR
console.log(`1 USD is ${currencies.convert(1, 'USD', 'EUR')} EUR`);
loadCurrencies
Loads the current currency conversion rates from the Shopify CDN. Every call to this function will fetch the latest rates from the Shopify CDN, so cache the result if you need to.
const currencies = await loadCurrencies();
currencies.rates
The rates
object contains the conversion rates for the currencies Shopify supports.
The currency codes are three-letter ISO codes.
type Rates = {
[currencyCode: string]: number;
};
const { rates } = await loadCurrencies();
// Conversion rates for EUR
console.log(`Conversion rates for EUR: ${rates.EUR}`);
currencies.convert
The convert
function converts an amount from one currency to another. The conversion is implemented as amount * rates[from] / rates[to]
.
type Convert = (amount: number, from: string, to: string) => number;
const { convert } = await loadCurrencies();
const dollars = 5;
const euros = convert(dollars, 'USD', 'EUR');
FAQs
Simple wrapper to access Shopify's currency conversion rates from Node.js
We found that shopify-currencies.js 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.