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

cloudinate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudinate

Batch upload files to Cloudinary.

  • 0.2.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cloudinate

npm version dependency status devdependency status downloads

Batch upload files to Cloudinary

Cloudinate automates uploading files to Cloudinary. It accepts a glob pattern and uploads all files that match the pattern to Cloudinary. Cloudinate is meant to simplify the uploading of assets for the metalsmith-cloudinary plugin, but can of course be used for other purposes as well.

Installation

$ npm install cloudinate

Cloudinate can also be installed globally with npm install cloudinate -g

Usage

local install

If you've installed cloudinate locally you could use a script upload.js:

var cloudinate = require('cloudinate');

// Settings
var keys = require('./keys')

cloudinate({
  keys: keys,
  files: './images/*.jpg'
});

Where keys.js is a module that exports your api keys like so:

// Ignore this with your .gitignore
module.exports = {
  'cloud_name': 'your_cloud_name_here',
  'api_key': 'your_api_key_here',
  'api_secret': 'your_api_secret_here'
}

Run the above script with node upload.js.

global install

Or if you've installed cloudinate globally, you can run it from the command line like so:

$ cloudinate -k 'keys.js' -f 'images/**/*.jpg'

Options

You can pass the following options:

  • files: a glob pattern of the files to upload (required, command line flag: -f)
  • keys: an object containing your Cloudinary cloud_name, api_key and api_secret (required, command line flag: -k)
  • relativeTo: a path, public_ids will be generated relative to this path (optional, command line flag: -r)

What does it do

Cloudinate will upload the files that match the supplied pattern. Uploaded files will be given a public_id according to their relative path and name, to make subsequent retrieval easier.

For example, successfully uploading images/1.jpg would result in output that resembles:

{
  public_id: 'images/1',
  version: {version number here},
  signature: {signature number here},
  width: 7200,
  height: 10800,
  format: 'jpg',
  resource_type: 'image',
  created_at: '2016-02-20T12:44:44Z',
  tags: [],
  bytes: 3008861,
  type: 'upload',
  etag: {etag number here},
  url: 'http://res.cloudinary.com/{cloud_name_here}/image/upload/v{version_number_here}/images/1.jpg',
  secure_url: 'https://res.cloudinary.com/{cloud_name_here}/image/upload/v{version_number_here}/images/1.jpg',
  original_filename: '1'
}

License

MIT

FAQs

Package last updated on 22 Feb 2016

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