npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qcloud-internal-cos

v2.2.0

Published

cos sdk for qcloud

Downloads

6

Readme

qcloud-internal-cos

nodejs sdk for [腾讯云COS服务]

安装

npm install qcloud-internal-cos

指定您的配置

修改conf.js中的配置信息或者如下设置

qcloud_cos.conf.setAppInfo('000000', 'xxxxxxxx', 'xxxxxxx');

程序示例

var qcloud = require('qcloud-internal-cos');

qcloud.conf.setAppInfo('100000', 'AKIDoooooooooooooooooooooooooooooooo', 'ROllllllllllllllllllllllllllllll');

/*
* 各接口的callback 为单个参数的function: function(ret){}
* ret 为 {'code':0,'message':'ok','data':{}} 的对象,其中data的内容依接口有所不同
*/

//上传文件
qcloud.cos.upload('/tmp/test.txt', 'bucket', 'text/1.txt','new myattr',1, function(ret){
    if (ret.code != 0) {
        console.log(ret);
    }else{
        // 查询文件
        qcloud.cos.statFile('bucket', 'text/1.txt', function(ret) {
            console.log(ret);
        });
        // 删除文件
        qcloud.cos.deleteFile('bucket', 'text/1.txt', function(ret) {
            console.log(ret);
        });
    }
});

//创建目录
qcloud.cos.createFolder('bucket', '/firstDir/');

//获取指定目录下文件列表
qcloud.cos.list('bucket', '/firstDir/', 20, 'eListFileOnly');

//获取bucket下文件列表
qcloud.cos.list('bucket', '/', 20, 'eListFileOnly');

//获取指定目录下以'abc'开头的文件
qcloud.cos.prefixSearch('bucket', '/firstDir/', 'abc', 20, 'eListFileOnly');

//设置文件权限以及自定义header
var headers = {
    "Cache-Control": "no-cache",
    "Content-Type" : "application/json",
    "Content-Encoding" : "utf-8"
};

qcloud_cos.cos.updateFile('0001', '123/test_slice.dat', 'newattr', 'eWRPrivate', headers, function(ret) {console.log(ret)});