npm i --save nativescript-utilities
- 版本:0.1.0
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-utilities
- 下载
- 昨日: 0
- 上周: 0
- 上月: 0
nativeScript-utilities
(目前规模较小) 一系列可重用的 NativeScript 工具类和函数的集合。
使用方法
查看当前工具类的文档,请访问 API 文档。每个类和函数都可以通过名称导入
import { Logger, convertUint8ArrayToReference } from 'nativescript-utilities';
try {
let bytesReference = convertUint8ArrayToReference(new Uint8Array([ 0x90, 0xC3, 0xFF ]));
// Do something with the interop.Reference instance, like pass it to some native C library.
} catch (error) {
logger.error(`Something happened while trying to send the buffer.`, { error });
}
构建
此模块使用 ES 6 实现,并转译为 ES 5 以进行导出。要构建源代码
npm run build
还有一个 git 预提交钩子,会在提交时自动构建,因为 dist 目录已被提交。
代码风格检查
npm run lint