【问题标题】:What is the difference between web3.js and web3-light.js?web3.js 和 web3-light.js 有什么区别?
【发布时间】:2018-08-18 23:16:19
【问题描述】:

大家! web3.js library 中的 web3.js 和 web3-light.js 文件有什么区别?

【问题讨论】:

    标签: ethereum solidity web3js


    【解决方案1】:

    web3.js 包含 bignumber.js 模块,而 web3-light.js 不包含。

    长答案:

    web3.jsopen-source 项目,所以让我们看看里面有什么。 Web3 使用 Gulp 构建系统来生成不同版本的库。负责light 风味的代码如下所示:

    gulp.task('light', ['clean'], function () {
        return browserify(browserifyOptions)
            .require('./' + src + '.js', {expose: 'web3'})
            .ignore('bignumber.js')
            .require('./lib/utils/browser-bn.js', {expose: 'bignumber.js'}) // fake bignumber.js
            .add('./' + src + '.js')
            .bundle()
    });
    

    bignumber.js 是用于任意精度十进制和非十进制的 JavaScript 库 算术。

    【讨论】:

      猜你喜欢
      • 2022-07-08
      • 2018-10-09
      • 2019-09-13
      • 2019-01-10
      • 2018-08-23
      • 2023-03-10
      • 2018-12-01
      • 2019-07-15
      • 2022-07-14
      相关资源
      最近更新 更多