在JS中我可以要求()只从模块导出吗?

时间:2018-01-20 16:28:35

标签: javascript node.js npm requirejs

换句话说,我可以这样做:

Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see ... The missing file is ..\..\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props

Warning The referenced component 'Xamarin.Forms.Platform.Android' could not be found.
Warning The referenced component '***' could not be found. (for all my references except my own added reference "shared code")

Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.

Warning "\packages\Xamarin.Forms.2.5.0.122203\build\netstandard1.0\Xamarin.Forms.props" cannot be imported again. It was already imported at "\RajaChat.Android\RajaChat.Android.csproj (3,3)". This is most likely a build authoring error. This subsequent import will be ignored.

带有require()语句??

上面的代码需要在我必须编写的小模块中,所以我不能使用import

2 个答案:

答案 0 :(得分:1)

const Binance = require('binance-api-node').default;

const client = Binance();

答案 1 :(得分:0)

如果你想使用 ES 模块试试这个:

import Binance from 'binance-api-node'
const client = Binance.default()
相关问题