cfenv 1.0.0 with new getServiceCreds() method

Share this post:

I’ve updated the node.js cfenv package at npm:

  • moved from the netherworld of 0.x.y versioned packages to version 1.0.0
  • updated some of the package dependencies
  • added a new appEnv.getServiceCreds(spec) method

In case you’re not familiar with the cfenv package, it’s intended to be the Swiss army knife of handling your Cloud Foundry runtime environment variables,

Here’s a quick example that doesn’t including accessing services in

You can start your server with this kind of snippet, which provides the
correct port, binding address, and url of the running server; and it will
run locally as well as on CloudFoundry.

For more information, see the cfenv readme.

new API appEnv.getServiceCreds(spec)

Lately I’ve been finding myself just needing the credentials property value from
service objects. To make this just a little bit easier than:

you can now do this, using the new

No need to get the whole service if you don’t need it, and you don’t have to
type out credentials all the time 🙂

what else?

What other gadgets does cfenv need? If you have thoughts, don’t hesitate
to open an issue, send a pull request, etc.

Add Comment
No Comments

Leave a Reply

Your email address will not be published.Required fields are marked *

More How-tos stories

A predictive Machine Learning model from Build to Retrain

This post is an excerpt from our solution tutorial that walks you through the process of building a predictive machine learning model, deploying it as an API to be used in applications, testing the model and retraining the model with feedback data. All of this happening in an integrated and unified self-service experience on IBM Cloud.

Continue reading

IBM Announces Promotions for Cloud Servers and Components

IBM is excited to announce 50% off list price for 60 days on selected virtual server and bare metal server offerings. This is your chance to try out a wide variety of IBM Cloud infrastructure offerings – from our fast, flexible and easily provisioned virtual servers to our high performance, totally customizable bare metal servers running Intel®'s Xeon® Scalable processors – perfect for driving today's HPC and cognitive / analytics workloads to new performance levels.

Continue reading

IBM Cloud Container Service Live in São Paulo, Brazil

IBM Cloud Container Service is a managed Kubernetes service providing an intuitive user experience with on-going cluster management. Built-in security and isolation to enable rapid delivery of apps, while leveraging IBM Cloud Services including Weather data, IoT, Analytics, or AI capabilities with Watson. Available in six IBM regions WW, including 20+ datacenters.

Continue reading