cloudinary-connection-string

1.0.4 • Public • Published

Functions for dealing with a Cloudinary connection string

NPM

Based on pg-connection-string for faster productivity.

Avoid 3 separate env vars.

Usage

const parse = require('cloudinary-connection-string').parse
const config = parse("cloudinary://345861234570132:D2-34ddopiV9N3edr28dV34daef@dhabtaskf") // env var

console.log(config)

// {
//   cloud_name: "dhabtaskf"
//   api_key: "345861234570132"
//   api_secret: "D2-34ddopiV9N3edr28dV34daef"
// }

// cloudinary.config(config)
const stringify = require('cloudinary-connection-string').stringify
const cloudinaryString = stringify({cloud_name, api_key, api_secret}) // pass an object

Test

Uncomment test/index.js file and test it

yarn add -D mocha chai
yarn mocha test

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i cloudinary-connection-string

      Weekly Downloads

      2

      Version

      1.0.4

      License

      MIT

      Unpacked Size

      2.72 kB

      Total Files

      4

      Last publish

      Collaborators

      • xup3rr