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. 在JSP使用EL中判断指定元素是否存在于指定集合中

    在JSP使用EL中判断指定元素是否存在于指定集合中 1.问题描述 在JSP页面中使用EL表达式判断一个指定元素是否存在于指定集合中? 2.问题解决 eg:指定集合:collection:{1,2,3, ...

  2. PHP 笔记——自定义函数

    1. 定义函数 function function_name ([$arg_1],[$arg_2], ... [$arg_n]){ fun_body; [return arg_n;] } 在PHP中, ...

  3. BZOJ 2151 种树(循环链表)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=2151 [题目大意] 在一个长度为n的数字环中挑选m个不相邻的数字使得其和最大 [题解] ...

  4. [JOISC2014]水筒

    OJ题号: BZOJ4242.AtCoder-JOISC2014E 题目大意: 给你一个h*w的网格图,每个格子可能是空地.障碍物和建筑物. 你只可以从空地上走过或者从建筑物中穿过. 建筑物总共有p个 ...

  5. bzoj 4127 线段树维护绝对值之和

    因为d>=0,所以一个位置的数只会单调不降并且只会有一次穿过0. 用这个性质,我们我可在线段树中记录正数负数的个数和和,以及最大的负数以及答案. 修改操作:如果当前最大负数+d<=0,那么 ...

  6. bzoj 1337 最小圆覆盖

    /************************************************************** Problem: 1337 User: idy002 Language: ...

  7. libuuid.so: cannot open shared object file: No such file or directory

    在玩ngx-lua时候有个 resty-uuid 需要引用 libuuid.so 动态库 打印log提示信息是这样的: libuuid.so: cannot open shared object fi ...

  8. 华为S5300系列升级固件S5300SI-V100R005C01SPC100.cc

    这个固件附带了web,注意,这个插件是升级V200的必经固件,所以必须升级为此固件之后才能往下升级. 升级小插曲: 1.升级的使用使用Windows,不要用Mac或者Linux,因为从Mac/Linu ...

  9. HowTo: Restart SSH Service under Linux / UNIX

    How do I restart SSH service under Linux or UNIX operating systems? The command to restart ssh are a ...

  10. WINDOWS 线程 纤程 进程

    http://www.cnblogs.com/edisonchou/p/4848131.html#3277980