repl.it
@matthewhudson/

webpipe-examples

Nodejs

Easy access to the latest JS client and live services demo against..

fork
loading
Files
  • index.js
  • package-lock.json
  • package.json
index.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
const webpipe = require('webpipe')

const url = "https://webpip.es/parse-url";
const inputs = { url: "https://www.youtube.com/watch?v=okgHFFjWkh4" };

webpipe.execute(url, inputs, (er, { outputs }) => {
  if (er) throw new Error(er.message)

  console.log(outputs)
  /*
  [ { parts:
     { protocol: 'https:',
       slashes: true,
       auth: null,
       host: 'www.youtube.com',
       port: null,
       hostname: 'www.youtube.com',
       hash: null,
       search: '?v=okgHFFjWkh4',
       query: 'v=okgHFFjWkh4',
       pathname: '/watch',
       path: '/watch?v=okgHFFjWkh4',
       href: 'https://www.youtube.com/watch?v=okgHFFjWkh4' } } ]
  */
  return outputs

})
node v10.16.0