Package Exports
- @artsy/gemup
- @artsy/gemup/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@artsy/gemup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gemup
Lightweight Javascript utility for using Artsy's Gemini service to upload directly to S3. Used internally at Artsy, so not useful to general public—but open source by default!
Installation
Use gemup
one of three ways:
Install with Yarn/NPM
yarn add @artsy/gemup
Example usage
JavaScript
Import into your project:
import gemup from "@artsy/gemup";
Add an upload function and reference it on an <input>
:
const handleUploadClick = (e) => {
gemup(e.target.files[0], {
app: "force",
geminiHost: 'https://media.artsy.net',
fail: function (err) {
console.log("Ouch!", err);
},
add: function (src) {
console.log("We got a data-uri image client-side!", src);
},
progress: function (percent) {
console.log("<3 progress bars, file is this % uploaded: ", percent);
},
done: function (src) {
console.log("Done uploading, here's the S3 url: ", src);
},
});
};
...
<input type="file" multiple={false} onChange={(e) => handleUploadClick(e)} />
License
MIT