Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
crypto-price.js
Advanced tools
crypto-price.js es un paquete Node.js que te permite obtener información sobre el precio de las criptomonedas en tiempo real utilizando la API de CoinGecko.
Puedes instalar este paquete a través de npm utilizando el siguiente comando:
npm install crypto-price.js
Para comenzar a utilizar crypto-price.js, simplemente importa el paquete en tu proyecto y llama a las funciones disponibles. Aquí tienes un ejemplo de cómo obtener el precio de Bitcoin (BTC) en dólares estadounidenses (USD):
const cryptoPrice = require('crypto-price.js');
(async () => {
try {
const bitcoinPrice = await cryptoPrice.getCryptoPrice('bitcoin');
console.log('Precio de Bitcoin en USD:', bitcoinPrice);
} catch (error) {
console.error(error);
}
})();
La función getCryptoPrice permite obtener un valor específico de una criptomoneda a partir de su identificador (coinId) y la propiedad (property) en el objeto JSON de la respuesta.
Parámetros
const cryptoPrice = require('crypto-price.js');
(async () => {
try {
const bitcoinMXNPrice = await cryptoPrice.getCryptoPrice('bitcoin', 'market_data.current_price.mxn');
console.log('Precio de Bitcoin en MXN:', bitcoinMXNPrice);
} catch (error) {
console.error(error);
}
})();
La función listTopCryptos permite listar las principales criptomonedas por capitalización de mercado. Puedes especificar el número máximo de criptomonedas que deseas listar utilizando el parámetro limit.
Parámetros
const cryptoPrice = require('crypto-price.js');
(async () => {
try {
const topCryptos = await cryptoPrice.listTopCryptos(20); // Listar las 20 principales criptomonedas
console.log('Principales criptomonedas:', topCryptos);
} catch (error) {
console.error(error);
}
})();
FAQs
A Node.js package for retrieving real-time cryptocurrency information and calculating cryptocurrency values in various currencies.
The npm package crypto-price.js receives a total of 1 weekly downloads. As such, crypto-price.js popularity was classified as not popular.
We found that crypto-price.js 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.