`
sillycat
  • 浏览: 2552102 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

TypeScript and NodeJS Package and Dependency

 
阅读更多
TypeScript and NodeJS Package and Dependency


Recently, my project requires a base64 library. I was confused at first.
I think both base64 library works, but they are all nodeJS library. When I have it in my TypeScript project dependencies, they are saying we need something with @type there.
So we need to have something like this:
"@types/base-64": "^0.1.3",
I was thinking this will including base-64 library as well. But actually it does not, we will need both.
"@types/base-64": "^0.1.3",
"base-64": "^0.1.0",

Here is how we use that
import * as base64 from 'base-64';
const msg = base64.decode(msgRaw);
References:
https://github.com/mathiasbynens/base64
https://github.com/dankogai/js-base64
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics