How to use the hexo-fs.createReadStream function in hexo-fs

To help you get started, we’ve selected a few hexo-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hexojs / hexo-cli / test / scripts / init.js View on Github external
function compareFile(a, b) {
    const streamA = new util.HashStream();
    const streamB = new util.HashStream();

    return Promise.all([
      pipeStream(fs.createReadStream(a), streamA),
      pipeStream(fs.createReadStream(b), streamB)
    ]).then(() => streamA.read().equals(streamB.read()));
  }
github hexojs / hexo-cli / test / scripts / init.js View on Github external
function compareFile(a, b) {
    const streamA = new util.HashStream();
    const streamB = new util.HashStream();

    return Promise.all([
      pipeStream(fs.createReadStream(a), streamA),
      pipeStream(fs.createReadStream(b), streamB)
    ]).then(() => streamA.read().equals(streamB.read()));
  }
github 75k / hexo-deployer-cos-enhanced / lib / main.js View on Github external
return new Promise((resolve, reject) => {
        cos.putObject({
            Bucket: config.bucket,
            Region: config.region,
            Key: file,
            Body: fs.createReadStream(filePath),
            ContentLength: fs.statSync(filePath).size,
            onProgress: function (progressData) {
                //console.log(JSON.stringify(progressData));
            },
        }, (err, data) => {
            if (err) {
                reject(err);
            } else {
                resolve(data);
            }
        })
    })
}
github hexojs / hexo / lib / plugins / generator / asset.js View on Github external
      data.data = () => fs.createReadStream(source);
    }
github ele828 / hexo-prism-plugin / src / index.js View on Github external
        data: () => fs.createReadStream(path.join(prismLineNumbersPluginDir, 'prism-line-numbers.min.js'))
      });
github ele828 / hexo-prism-plugin / src / index.js View on Github external
    data: () => fs.createReadStream(prismThemeFilePath)
  }];
github sdlzhd / hexo-deployer-cos / lib / deployer.js View on Github external
return new Promise((resolve, reject) => {
    cos.putObject({
      Bucket: config.Bucket,
      Region: config.Region,
      Key: file.name,
      Body: fs.createReadStream(file.path)
    }, (err, data) => {
      if (err) {
        reject(err)
      } else {
        resolve(data)
      }
    })
  })
}
github MoePlayer / hexo-tag-dplayer / index.js View on Github external
data: function() {
              return fs.createReadStream(filePath);
            }
          }
github MikeCoder / hexo-blog-encrypt / index.js View on Github external
    'data': () => fs.createReadStream(path.resolve(__dirname, './lib/blog-encrypt.js')),
    'path': 'lib/blog-encrypt.js',