Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

curtail

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curtail

Curtail is a simple browser based image manipulation library. Currently the only functionality offered by Curtail is cropping but more functionality is coming soon.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-85%
Maintainers
1
Weekly downloads
 
Created
Source

Curtail

Curtail is a simple browser based image manipulation library. Currently the only functionality offered by Curtail is cropping but more functionality is coming soon.

Installation

To use Curtail, you can install it from npm and import it into your project.

$ npm install --save curtail

import { Curtail } from './node_modules/curtail/curtail.js';

const curtail = new Curtail();

or you can just download the curtail.js file and import as above, just from a different directory.

API

Crop

The crop function in Curtail takes an image and a set of options as parameters. The image provided must be from a local source and the options will default to 0 if not specified

const options = {
    locX: 50,        // The x position in the original image to begin cropping.
    locY: 75,        // The y position in the original image to being cropping.
    size: '350x500'  // The dimension to crop out of the original image beginning at the starting location.
};

const croppedImage = await Curtail.crop('./images/placeholder.png', options);
// Returns an image element with the newly cropped image.

## License

MIT

Keywords

FAQs

Package last updated on 12 Jul 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc