Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
modal-cropper
Advanced tools
Promise-based, simplified, single-function library for very basic image crop operation on browser side and in modal.
Promise-based, simplified, single-function library for very basic image crop operation on browser side and in modal.
This library depends on Tingle and Cropper.js.
Actually all this library do is to wrap this two libraries into very simple function that just work for specific purpose.
npm install --save modal-cropper
@import url('~tingle.js/dist/tingle.css');
@import url('~cropperjs/dist/cropper.css');
var cropper = require('modal-cropper');
async function someFunction() {
// assuming user choose an image from input
// var file = file_input[0].files[0];
// or you have a Blob object with
// and you want 1920x1080 JPG image from it
try {
var result = await cropper(file, 1920, 1080, 'jpg');
if(result) {
// call your favorite http client to upload the picture
} else {
// user cancelled the operation
}
} catch(e) {
// some exception occur
}
}
This library supports CommonJS and AMD specs, if you do not use a proper CommonJS or AMD loader, you need to include Tingle, Cropper.js and index.js and use window.modal_cropper in your code.
If you use ES5 syntax in your project, instead of using await, you can use .then to get the results from this library.
Pull requests and issues are welcome!
© 2018 Burak Tamturk
© 2018 Robin Parisi
© 2015 Chen Fengyuan
Released under the MIT LICENSE
FAQs
Promise-based, simplified, single-function library for very basic image crop operation on browser side and in modal.
The npm package modal-cropper receives a total of 5 weekly downloads. As such, modal-cropper popularity was classified as not popular.
We found that modal-cropper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.