How to use the probe-image-size/package.json.version function in probe-image-size

To help you get started, we’ve selected a few probe-image-size 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 nodeca / nodeca.core / lib / app / message_images_fetch.js View on Github external
module.exports = function (N, params) {

  let rootUrl = _.get(N.config, 'bind.default.mount', 'http://localhost') + '/';
  let userAgent = `${probe_pkg.name}/${probe_pkg.version} (Nodeca; +${rootUrl})`;

  let request = _request.defaults({
    timeout: 120000,
    headers: { 'User-Agent': userAgent },
    agentOptions: {
      keepAlive: true,
      keepAliveMsecs: 15000,
      maxFreeSockets: 512
    }
  });

  function get_size(url) {
    return new Promise((resolve, reject) => {
      let req;

      try {
github nodeca / nodeca.core / lib / autoload / jobs / image_sizes_fetch.js View on Github external
module.exports = function (N) {

  let rootUrl = _.get(N.config, 'bind.default.mount', 'http://localhost') + '/';
  let userAgent = `${probe_pkg.name}/${probe_pkg.version} (Nodeca; +${rootUrl})`;

  let request = _request.defaults({
    timeout: 120000,
    headers: { 'User-Agent': userAgent },
    agentOptions: {
      keepAlive: true,
      keepAliveMsecs: 15000,
      maxFreeSockets: 512
    }
  });

  function get_size(url) {
    return new Promise((resolve, reject) => {
      let req;

      try {

probe-image-size

Get image size without full download (JPG, GIF, PNG, WebP, BMP, TIFF, PSD)

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis