-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo-recursive.js
28 lines (21 loc) · 1.01 KB
/
demo-recursive.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
*
* Package: requireurl
* Author: Ganesh B
* Description:
* Install: npm i require-urls --save
* Github: https://github.com/ganeshkbhat/requireurl
* npmjs Link: https://www.npmjs.com/package/require-urls
* File: demos/demo.mjs
* File Description: Using requireurl instead of require to fetch files from git repositories like Github or Bitbucket like repository directly
*
*/
/* eslint no-console: 0 */
'use strict';
// // Following needs recursive url import
let c = require("../index");
let d = c("https://github.com/cgi-js/cgi-js/blob/main/src/index.js", { baseType: "git", recursive: true, forceUpdate: true, logger: console.log, cacheFetch: false, getMethods: false, noRequire: false });
console.log("[require-urls] demo-recursive.js: Getting cgi-js file: ", d.then(r => console.log(r)));
// let d = import("https://github.com/cgi-js/cgi-js/blob/main/src/index.js");
// console.log(d.then(r => console.log(r.source)));
// requireurls.then(d => console.log("Testing returns", d));