
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
autocrop-js
Advanced tools
Node.js utility that crops the transparent background of an image.
npm install autocrop-js
import autocrop from 'autocrop-js'
const dataURL = 'data:image/png;base64,...'
autocrop(dataURL, {
alphaThreshold: 10 // the lines and columns will be removed if the alpha channel is below the specified value (0-255). Default: 0
}).then(result => {
console.log(result)
})
Output:
{
bbox: { // bounding box of the cut image fragment
height: 188,
width: 232,
x: 26,
y: 0
},
dataURL: 'data:image/png;base64,iVB...' // Data URL of the cut image fragment
}
npm test
npm run lint
If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.
FAQs
Node.js utility that crops the transparent background of an image
The npm package autocrop-js receives a total of 26 weekly downloads. As such, autocrop-js popularity was classified as not popular.
We found that autocrop-js 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.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.