How to use browserify-mime - 3 common examples

To help you get started, we’ve selected a few browserify-mime 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 Azure / azure-storage-node / lib / services / blob / blobservice.browser.js View on Github external
var creationCallback = function (createError, createBlob, createResponse) {
    if (createError) {
      callback(createError, createBlob, createResponse);
    } else {
      // Automatically detect the mime type
      if(azureutil.tryGetValueChain(options, ['contentSettings','contentType'], undefined) === undefined) {
        azureutil.setObjectInnerPropertyValue(options, ['contentSettings','contentType'], mime.lookup(browserFile.name));
      }

      var stream = new BrowserFileReadStream(browserFile);
      var streamCallback = function (createError, createBlob, createResponse) {
        if (azureutil.objectIsFunction(stream.destroy)) {
          stream.destroy();
        }
        callback(createError, createBlob, createResponse);
      };
      self._uploadBlobFromStream(true, container, blob, blobType, stream, browserFile.size, options, streamCallback);
    }
  };
github Azure / azure-storage-node / lib / services / blob / blobservice.node.js View on Github external
var creationCallback = function (createError, createBlob, createResponse) {
    if (createError) {
      callback(createError, createBlob, createResponse);
    } else {
      // Automatically detect the mime type
      if(azureutil.tryGetValueChain(options, ['contentSettings','contentType'], undefined) === undefined) {
        azureutil.setObjectInnerPropertyValue(options, ['contentSettings','contentType'], mime.lookup(localFileName));
      }

      var stream = new FileReadStream(localFileName, { calcContentMd5: options.storeBlobContentMD5 });
      var streamCallback = function (createError, createBlob, createResponse) {
        if (azureutil.objectIsFunction(stream.destroy)) {
          stream.destroy();
        }
        callback(createError, createBlob, createResponse);
      };
      self._uploadBlobFromStream(true, container, blob, blobType, stream, size, options, streamCallback);
    }
  };
github FieldDB / FieldDB / api / audio_video / AudioVideo.js View on Github external
value: function(filename) {
      var guessedType = mime.lookup(filename);
      return guessedType;
    }
  },

browserify-mime

A comprehensive library for mime-type mapping (with browserify support)

MIT
Latest version published 12 years ago

Package Health Score

68 / 100
Full package analysis

Popular browserify-mime functions

Similar packages