Skip to content

Functions for dealing with a Cloudinary connection string. Test publishing an NPM package

Notifications You must be signed in to change notification settings

xup3rr/cloudinary-connection-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Functions for dealing with a Cloudinary connection string. Test publishing an NPM package

Resources

Stars

Watchers

Forks