1.1.9 • Published 6 years ago

qcloud-image-sdk v1.1.9

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

腾讯云智能图像服务 SDK for NodeJs

NPM

npm npm Build Status Coverage Status Known Vulnerabilities Dependency Status David npm

安装

npm install qcloud-image-sdk

运行单元测试

npm run test

生成覆盖率报告

npm run coverage

运行单元测试并生成覆盖率报告

npm run test-coverage

范例

const sdk = require('qcloud-image-sdk');
const fs = require('fs');
const path = require('path');

const config = new sdk.QCloudConfig('appId', 'secretId', 'secretKey', 'bucket', 'region');
const client = new sdk.ImageClient(config);

/**
 * 获取唇语字符串
 */
client.liveGet()
    .then((data) => {
        console.log(data);
    })
    .catch((err) => {
        console.error(err);
    });

/**
 * 检测身份证
 */
client.idCardDetect(path.join(__dirname, 'test.jpg'))
    .then((data) => {
        console.log(data);
    })
    .catch((err)=>{
        console.error(err);
    });

/**
 * 活体检测
 */
client.idCardLiveDetect(path.join(__dirname, 'test.mp4'), '8603', '艾米', '4522876121211222222')
    .then((data) => {
        console.log(data);
    })
    .catch((err)=>{
        console.error(err);
    });

/**
 * 计算文件的md5值,例如:60924334a39ea59142317320e86fcda2
 */
sdk.FileUtil.getFileMd5String(path.join(__dirname, 'test.js'))
    .then((data) => {
        console.log(data);
    })
    .catch((err)=>{
        console.error(err);
    });

/**
 * 获取文件的完整md5路径
 * 例如:
 *      60/92/60924334a39ea59142317320e86fcda2.js
 */
sdk.FileUtil.getMd5StringFilePath(path.join(__dirname, 'test.js'))
    .then((data) => {
        console.log(data);
    })
    .catch((err)=>{
        console.error(err);
    });

/**
 * 获取流文件的MD5值
 */
sdk.FileUtil.getStreamMd5String(fs.createReadStream(path.join(__dirname, 'test.js')))
    .then((data) => {
        console.log(data);
    })
    .catch((err)=>{
        console.error(err);
    });
1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago