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

moto-connector

v1.5.23

Published

JAN平台SDK

Downloads

18

Readme

moto-connector

const MotoConnector = require("moto-connector");

Init

项目初始化

let init = new MotoConnector.Init(FEB, APPNAME, SECRET, console);
// APPNAME, SECRET请上FEB平台申请
创建仓库

返回类型为Promise(内含gitlab地址信息),可与yield或async/await搭配使用

init.create("/api/bridge/%s/scaffold?secret=%s", {
  group: "gitlab分组名",
  name: "gitlab仓库名",
  description: "描述",
  scaffold: "模板[分组名/仓库名]路径,如dolly/moto-scaffold",
  version: "模板版本,默认为master",
  passRender: 是否渲染,默认开启为true
}, [headers]);
clone仓库到本地
init.clone("gitlab地址", "本地目录名", {
  base: "基准路径",
  branch: "clone的分支,默认为master",
  depth: clone层数,默认为完整clone,
  force: 如果目录已存在,是否强制清空?
});
分支是否存在
init.isExists("分支名", "目标git目录");
切换分支

第二个参数为分支类型(可选值为'x'、'y'、'z'),对应版本号x.y.z的三个位置

init.branch("分支名称", "x/y/z三选一", "目标git目录");
安装npm依赖
init.npm("package.json所在目录", {
  registry: "registry地址,默认可不填"
});

Deploy

部署到CDN

let deploy = new MotoConnector.Deploy(FEB, APPNAME, SECRET, console);
// APPNAME, SECRET请上FEB平台申请

deploy.push("/api/bridge/%s/publish?secret=%s", "提交内容commit注释", {
  dir: "本地git目录",
  dist: "目标发布目录,比如build、dist目录",
  email: "gitlab Email",
  user: "gitlab User",
  publish: 是否正式发布,默认为false
});

Login

用户登录

let login = new MotoConnector.Login(FEB, APPNAME, SECRET, console);
// APPNAME, SECRET请上FEB平台申请

login.check("/api/validate/%s/gituser?secret=%s", "gitlab邮箱", "密码");