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.
Image cropper utility that crops an image in any polygonal shape chosen and returns a base64 of the cropped area.
Image cropper utility that crops an image in any polygonal shape chosen and returns a base64 of the cropped area.
$ npm install idcrop
const IdCrop = require("idcrop");
const idcrop = new IdCrop({
displaySelector: "#display",
toolbarSelector: "#toolbar",
previewSelector: "#preview"
});
idcrop.init();
The only required key in the configuration object is the CSS selector for the display area, but we have a bunch of configuration options that will be listed below.
Some events are dispatched to the document
in some key actions done to the cropper. These events are:
created
Dispatched when the IdCrop is loaded or reset. detail The IdCrop configuration object.handleCreated
Dispatched when a new handle is created. detail The x and y position of the created handle.resized
Dispatched when a handle is moved. detail The new x and y position of the moved handle.crop
Dispatched when a crop action happens. detail The dataURI for the image created.Right now we only have one getter method for the IdCrop which is:
idcrop.getPoints
This method returns a list with all the points added to the image relative to the real image size.You can create a container for display (cropping area), toolbar (for now, only filename) and preview (cropped area preview). Only the display area is required though.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>IdCrop</title>
<link rel="stylesheet" type="text/css href="https://unpkg.com/idcrop@1.2.2/dist/css/main.min.css">
</head>
<body>
<div id="display"></div>
<div id="toolbar"></div>
<div id="preview"></div>
</body>
</html>
$ npm install & npm start
We use a combination of eslint and prettier for the formatting and linting of our JS code.
$ npm run lint
$ npm run fix
We have a small npm script that handles the bumping of the version and the publishing of the package for us.
$ npm --no-git-tag version <newversion>
Copyright © 2017, Idwall. Released under the MIT license.
FAQs
Image cropper utility that crops an image in any polygonal shape chosen and returns a base64 of the cropped area.
The npm package idcrop receives a total of 28 weekly downloads. As such, idcrop popularity was classified as not popular.
We found that idcrop 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.