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

mincloud

v1.3.4

Published

mincloud is an ifanr faas cli

Downloads

84

Readme

mincloud Build Status

这是一个用于知晓云云函数的命令行工具。

快速开始

  1. 安装运行时 node.js

  2. 安装本命令行工具

    通过 npm 安装:

    $ npm install -g mincloud

    通过 yarn 安装:

    $ yarn global add mincloud
  3. 调用

    $ mincloud
    用法:
     mincloud <command>
    
    支持的 command 有:
       delete, deploy, invoke, list, login, logout, new
    
    - mincloud: v1.1.0
    - node: v8.10.0

命令的使用

flag | 说明 ------------|------------------------------------- -j, --json | 调用命令成功后,以 json 格式返回结果 -e, --env | 可选,表示在指定的环境中执行命令

在知晓云设置页面,选择环境,并查看环境 ID。

删除云函数

必须先登录,请参考 mincloud login。谨慎操作,此操作会将服务器上的云函数删除。

$ mincloud delete <funciton_name>

参数 | 必填 | 默认值 | 说明 --------------|-------|--------|----------------- function_name | 是 | 无 | 已经存在的云函数

部署云函数

必须先登录,请参考 mincloud login

$ mincloud deploy <function_name> [cloud_function_root] [-m remark]

参数 | 必填 | 默认值 | 说明 --------------------|-------|---------------|-------------------------------------------------------------------------- function_name | 是 | 无 | 云函数名,指定的是 <funciton_name>.js 或者 <function_name>/index.js cloud_function_root | 否 | 当前目录 ./ | 用于存放云函数代码的本地目录

flag | 说明 --------------|------------------------------------ -m, --message | 备注信息

调用云函数

必须先登录,请参考 mincloud login

$ mincloud invoke <funciton_name> [data]

参数 | 必填 | 默认值 | 说明 --------------|-------|-------------|----------------- function_name | 是 | 无 | 已经存在的云函数 data | 否 | 空对象 {} | JSON 数据

列出云函数

必须先登录,请参考 mincloud login

$ mincloud list

登录

使用知晓云客户端凭证登录,令牌将保存在本地文件 .mincloudrc 中;若过期,请重新登录。

查找令牌的步骤:

  1. 在当前工作目录的 .mincloudrc 中查找 client_id;若找不到,则在用户根目录的 .mincloudrc 中查找。
  2. 通过找到的 client_id 到用户根目录的 .mincloudrc 中查找客户端登录凭证。
$ mincloud login <client_id> <client_secret>

参数 | 必填 | 默认值 | 说明 --------------|-------|--------|----------------------- client_id | 是 | 无 | 知晓云的客户端 ID client_secret | 是 | 无 | 知晓云的客户端密钥

flag | 说明 --------------|------------------------------------ -l, --local | 在当前工作目录保存 client_id

注销

$ mincloud logout

本地创建一个云函数文件

必须先登录,请参考 mincloud login

此命令将在服务器上创建一个简单的云函数,本地创建云函数代码, 文件夹即函数名,入口文件即 <function_name>/index.js

$ mincloud new <function_name> [cloud_function_root] [-m remark]

参数 | 必填 | 默认值 | 说明 --------------------|-------|---------------|-------------------------------------------------------------------------- function_name | 是 | 无 | 云函数名 cloud_function_root | 否 | 当前目录 ./ | 用于存放云函数代码的本地目录

flag | 说明 --------------|------------------------------------ -m, --message | 备注信息

从服务器上拉取一个已存在的云函数代码到本地

必须先登录,请参考 mincloud login

请谨慎操作,如果本地有此代码文件,将会覆盖。

$ mincloud pull <function_name> [cloud_function_root]

参数 | 必填 | 默认值 | 说明 --------------------|-------|---------------|-------------------------------------------------------------------------- function_name | 是 | 无 | 云函数名 cloud_function_root | 否 | 当前目录 ./ | 用于存放云函数代码的本地目录

运营后台部署

必须先登录,请参考 mincloud login

CLI 版本需大于等于 1.2.2。

该命令可将本地前端项目部署到运营后台。

$ mincloud dashboard-deploy <file_path>

参数 | 必填 | 默认值 | 说明 --------------------|-------|---------------|-------------------------------------------------------------------------- file_path | 是 | 无 | 文件路径,可以是一个目录,或者是一个 zip 文件。如果是 zip 文件,则注意压缩时需把项目根路径压缩,而不是把项目目录文件夹压缩。

flag | 说明 --------------|------------------------------------ -r, --refresh | 是否刷新管理后台部署地址,取值为:true or false。可为空,默认为 true。