INNER CODE UNIT · JavaScript

Promise

geekjourneyx/md2wechat-skill · scripts/install.js:77

  return new Promise((resolve, reject) => {
    const client = source.startsWith("https:") ? https : http;

    client
      .get(source, (response) => {
        if (
          (response.statusCode === 301 || response.statusCode === 302) &&
          response.headers.location
        ) {
          response.resume();
          downloadToFile(response.headers.location, destinationPath).then(
            resolve,
            reject
          );
          return;
        }

        if (response.statusCode !== 200) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…