We will see how you can use npx to pull and execute code from a GitHub repository. If you need even more control, you can target a specific branch of your repository to execute.

Using npx to access a remote github repo's branch:

npx <username>/<repo_name>#<branch_name>

For node, we have to have "bin" prop in package.json to tell which file to run:

"bin": {
"runthiscommand": "./index.js"
},

And for index.js file, on the top, you need to have:

#!/usr/bin/env node

[NPM] Execute Code from a Remote GitHub Branch with npx的更多相关文章

  1. 安装Vue2的devtools发生错误npm ERR! code EINTEGRITY npm ERR! sha1-HTFDXrRzR2Ew8Bv9zlMSCVgPsS0= integrity checksum failed when using sha1: wanted sha1-HTFDXrRzR2Ew8Bv9zlMSCVgPsS0= but got sha1-Z6BeTMF4nhAO6h5A

    1.github下载地址:https://github.com/vuejs/vue-devtools 2.下载好后进入vue-devtools-master工程  执行npm install ---- ...

  2. npm ERR! code ENOLOCAL

    Microsoft Windows [版本 ] 版权所有 (c) Microsoft Corporation.保留所有权利. G:\vue>cnpm i vue-router -S 'cnpm' ...

  3. CSDN CODE平台,中国版Github简要使用说明

    CSDN CODE平台,中国版Github简要使用说明!(多图慎入)   楼主说 以前一直看到别人在用github发布自己的代码,各种牛逼,各种羡慕嫉妒恨.最后终于受不了了,也去注册了一个,注册到没什 ...

  4. npm ERR! code EINTEGRITY npm! ERR! shal-

    npm ERR! code EINTEGRITY npm ERR! sha1-nbqdpC/e8IOA7poHctXL5+bVXsE= integrity checksum failed when u ...

  5. npm ERR! code ENOENT

    npm ERR! path F:\VsCodeWorkspace\labWeb\front\LabWebAdminFrontEnd\node_modules\core-jsnpm ERR! code ...

  6. npm install出错,npm ERR! code EINTEGRITY npm ERR! Verification failed while extracting url-parse@1.4.3

    npm install时出现以下错误: npm ERR! code EINTEGRITY npm ERR! Verification failed while extracting url-parse ...

  7. 解决NPM无法安装任何包的解决方案(npm ERR! code MODULE_NOT_FOUND)

    前言 今天突然发现npm无法使用了,执行任何命令都报如下错误: npm ERR! code MODULE_NOT_FOUND npm ERR! Cannot find module 'internal ...

  8. 执行npm install报错:npm ERR! code EINTEGRITY

    命令行执行npm install报错如下: D:\frontend\viewsdev>npm install npm ERR! code EINTEGRITY npm ERR! sha512-8 ...

  9. npm ERR! code: 'EPERM' (权限问题 errro permit)

    PS C:\Users\user\Desktop\test\my-project> npm run iview --save npm ERR! missing script: iview npm ...

随机推荐

  1. bzoj 1336 最小圆覆盖

    最小圆覆盖 问题:给定平面上的一个点集,求半径最小的一个圆,使得点集中的点都在其内部或上面. 随机增量算法: 定义:点集A的最小圆覆盖是Circle(A) 定理:如果Circle(A)=C1,且a不被 ...

  2. bzoj 2150 最小路径覆盖

    最小路径覆盖问题是:给定一个DAG,该DAG的一个路径覆盖是一个路径的集合,使得每个点属于且仅属于其中一条路径,问题就是求一个大小最小的路径集合. 做法是将每个点A拆成两个点A1,A2,如果A-> ...

  3. BZOJ 1191: [HNOI2006]超级英雄Hero 匈牙利算法

    1191: [HNOI2006]超级英雄Hero Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http:/ ...

  4. redis缓存穿透解决办法--排它锁

  5. 【scrapy】使用方法概要(一)(转)

    [请初学者作为参考,不建议高手看这个浪费时间] 工作中经常会有这种需求,需要抓取互联网上的数据.笔者就经常遇到这种需求,一般情况下会临时写个抓取程序,但是每次遇到这种需求的时候,都几乎要重头写,特别是 ...

  6. sublime插件汇总

    JsFormat javascript格式化 有时从网上扒了人家的js代码来学习学习,打开发现被压缩了,这时就能够用JsFormat插件格式化js代码,恢复未压缩时候的排版,挺给力的.按快捷键Ctrl ...

  7. oracle systemtap tracing

    https://github.com/LucaCanali?tab=repositories https://github.com/LucaCanali/Linux_tracing_scripts/t ...

  8. C#程序集系列02,使用记事本查看可执行程序集的IL代码

    继续上一篇"C#程序集系列01,用记事本编写C#,IL代码,用DOS命令编译程序集,运行程序",在F盘的as文件夹中已经有了若干程序集.本篇体验使用记事本查看可执行程序集的IL代码 ...

  9. 浅用block 转

    block是一门有用的大后期学问.现在我只是列出一点基本用法. 1.快速枚举(Enumeration) 通常是和NSArray, NSDictionary, NSSet, NSIndexSet放在一起 ...

  10. Android Gradle Plugin指南(四)——測试

    原文地址:http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Testing 5.Testing(測试) 构建一个測试 ...