Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

currency-transform

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-transform

汇率转换,内部使用百度汇率转换 `api`

  • 0.1.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

currency-transform

汇率转换,内部使用百度汇率转换 api

Install

Node.js 4 or higher

$ npm install currency-transform --save

Usage

var transform = require('currency-transform')
transform({
  apiKey: '', // add your baidu developer apiKey
  from: 'JPY',
  amount: 100
}).then(function(data) {
  console.log(data)
})

API

transform(options)

options 参数定义

  • options.apiKey API密钥
  • options.from 待转化的币种,默认 USD
  • options.to 转化后的币种,默认 CNY
  • options.amount 转化金额,默认 1

返回内容 data

{
  fromCurrency: 'USD', //待转化币种的简称,这里为美元
  toCurrency: 'CNY', //转化后的币种的简称,这里为人民币
  date: '2016-06-23', //日期
  time: '14:37:44', //时间
  currency: '6.576500', //当前汇率
  amount: 1, //转化的金额
  convertedamount: 6.5765 //转化后的金额
}

Keywords

FAQs

Package last updated on 23 Jun 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc