npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cloudimage

v0.1.1

Published

Minimalist CLI and programmatic stream-based interface for Cloudimage.io

Downloads

31

Readme

node-cloudimage Build Status Dependency Status NPM version

Minimalist node.js/io.js CLI & programmatic stream-based interface for Cloudimage.io

Installation

For command-line usage, install it as global package:

npm install -g cloudimage

For programmatic usage, install it in the tree dependency:

npm install cloudimage --save[-dev]

CLI

$ cloudimage --help
Usage: cloudimage [options] [command]

Commands:

  crop [options] [url]           Crop any image to a given square thumbnail in pixels
  width [options] [imageUrl]     Resize any image to a given width in pixels
  height [options] [imageUrl]    Resize the image to the given height in pixels
  resizei [options] [imageUrl]   The image will be resized to fit the given resolution box (but not cropped). White will be added for the padding, if needed
  resizenp [options] [imageUrl]  The image will be resized to fit the given resolution box (but not cropped). No padding will be added here
  cdn [options] [imageUrl]       Cache any image in our worldwide CDN, without any modification of the image

Options:

  -h, --help     output usage information
  -V, --version  output the version number

Examples:

  $ cloudimage crop -r 200x200 http://server.net/image.jpg
  $ cloudimage width -r 300 http://server.net/image.jpg
  $ cloudimage height -r 300 http://server.net/image.jpg
  $ cloudimage resizenp -r 300x200 http://server.net/image.jpg
  $ cloudimage cdn http://server.net/image.jpg
  $ cloudimage crop --id scvy0 http://server.net/image.jpg
  $ cloudimage crop --output test.jpg http://server.net/image.jpg

API

clouimage(imageUrl)

Constructor of the Cloudimage client

var fs = require('fs')
var Cloudimage = require('cloudimage')

var imageUrl = 'http://bit.ly/1Cqb78Z'

Cloudimage(imageUrl)
  .crop('200x200')
  .on('error', function (err) {
    console.error('Cannot resize the image:', err)
  })
  .pipe(fs.createWriteStream('new-image.jpg'))

Use a custom Cloudimage's customer ID:

Cloudimage.clientID = 'svrd10'

Cloudimage(imageUrl)
  .crop('100x100')
  .on('error', function (err) {
    console.error('Cannot resize the image:', err)
  })
  .pipe(fs.createWriteStream('new-image.jpg'))

cloudimage#crop(resolution)

Crop any image to a given square thumbnail in pixels. Example: 300x300

cloudimage#width(resolution)

Resize any image to a given width in pixels. Example: '200'

cloudimage#height(resolution)

Resize any image to a given height in pixels. Example: '200'

cloudimage#resizeInBox(resolution)

The image will be resized to fit the given resolution box (but not cropped). White will be added for the padding, if needed. Example: 300x200

cloudimage#resizeNP(resolution)

The image will be resized to fit the given resolution box (but not cropped). No padding will be added here. Example: 300x200

cloudimage#cdn()

Cache any image in our worldwide CDN, without any modification of the image. This will increase the response time in future requests

cloudimage.VERSION

Get the current module version

License

MIT © Tomas Aparicio