You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@getable/json-image-to-cloudinary

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getable/json-image-to-cloudinary

Takes a json array and field names. Replaces the value of those field names with a cloudinary url.

1.1.0
Source
npmnpm
Version published
Weekly downloads
13
Maintainers
2
Weekly downloads
 
Created
Source

json-image-to-cloudinary NPM version Build Status Dependency Status

Takes a json array and field names. Replaces the value of those field names with a cloudinary url.

Table of Contents generated with DocToc

Install

npm i -S @getable/json-image-to-cloudinary

Usage

CLI

CLOUDINARY_URL=cloudinary://<your url here> && json-image-to-cloudinary data.json -f image

Programmatic

import  from '@getable/json-image-to-cloudinary'

jsonImageToCloudinary(options, callback)

Options

-f, --field Required

Field to replace with a cloudinary url

-h, --help

show help

--overwrite

overwrite data on cloudinary, use this if your urls changed and you're running the script for a second time

-w, --widths

A comma separated list of widths to eagerly compute

-i, --id

Generate a cloudinary id from this string. Access keys in the object with ${}. e.g. --id="${category}/${id}"'

--width-names

Name a width for output as an object with width urls

e.g. --field=image --widths=50,100 --width-names='small:50,large:100}'

outputs:

{
  "image": "https://cloudinaryurl",
  "images": {
    "small": "https://cloudinaryurl-at-50",
    "large": "https://cloudinaryurl-at-100"
  }
}

--widths-key

Defaults to field + "s", but you can override here

Tests

Tests are in tape.

  • npm test will run the tests
  • npm run tdd will run the tests on every file change.

Developing

To publish, run npm run release -- [{patch,minor,major}]

NOTE: you might need to sudo ln -s /usr/local/bin/node /usr/bin/node to ensure node is in your path for the git hooks to work

Requirements

  • npm > 2.0.0 So that passing args to a npm script will work. npm i -g npm
  • git > 1.8.3 So that git push --follow-tags will work. brew install git

License

Artistic 2.0 © Joey Baker

Keywords

cli

FAQs

Package last updated on 13 May 2015

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