npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cf-client

v0.13.26

Published

A Cloud Foundry Client for Node.js

Downloads

112

Readme

cf-client

Build Status Build status Dependency Status devDependency Status Changelog API Doc

NPM

Table of Contents

Overview

This project provides a simple client library to interact with the Cloud Foundry Architecture:

ScreenShot

Using this library, you could interact with the following platforms: PWS , Bluemix or a Local Cloud Foundry instance:

| Cloud Controller | UAA | Logging & Metrics | |------------------------ |----------------------- |------------------------ | | Apps | Users | Logs | | Buildpacks | | | | Domains | | | | Jobs | | | | Organizations | | | | Organizations Quotas | | | | Routes | | | | Services | | | | Service Bindings | | | | Service Instances | | | | Service Plans | | | | Spaces | | | | Spaces Quotas | | | | Stacks | | | | User provided Services | | | | Users | | |

Focus

The development doesn't cover the whole CloudController API. Main areas of development are:

App life cycle:

  • Create an App
  • Upload source code in .zip or .war (Support for Static, Python, PHP, Node.js & JEE)
  • Create an User Provided Services
  • Associate Apps with an User Provided Services
  • Start | Stop an App
  • Restage Apps
  • Scale Apps
  • Simple Logs management
  • Remove Apps
  • Remove User Provided Services

PaaS Management:

  • Organization quota
  • Organization
  • Space
  • Services, Service Instances, Service Plans, User provided Services & Service Binding
  • UAA Users
  • Users

Getting Started

If you need to interact with a Cloud Foundry platform try this online tool and use this example:

"use-strict";

const endpoint = "https://api.ng.bluemix.net";
const username = "BLUEMIX_USERNAME";
const password = "BLUEMIX_PASSWORD";

const CloudController = new (require("cf-client")).CloudController(endpoint);
const UsersUAA = new (require("cf-client")).UsersUAA;
const Apps = new (require("cf-client")).Apps(endpoint);

CloudController.getInfo().then( (result) => {
    UsersUAA.setEndPoint(result.authorization_endpoint);
    return UsersUAA.login(username, password);
}).then( (result) => {
	Apps.setToken(result);
    return Apps.getApps();
}).then( (result) => {
    console.log(result);
}).catch( (reason) => {
    console.error("Error: " + reason);
});

Explore the library and if you like the features, use it on your App:


npm install cf-client --save

Testing

This project has a test suite to ensure the readability of this project. Take a look the Tests cases developed with Mocha & Chai to understand some stuff about Cloud Foundry and the usage of this client. Besides, the project has invested some amount of time in testing phase to be the code with a nice coverage level.

The development has been tested with:

| Local Instance | PWS | Bluemix | | -------------- |:-------------:| -------:| | 2.25.0 | 2.47.0 | 2.40.0 |

Last test: 2016/01/26

Testing against Bluemix:

export BLUEMIX_CF_API_URL=https://api.ng.bluemix.net && export BLUEMIX_username=$USERNAME && export BLUEMIX_password=$PASSWORD && npm run test:bluemix

Test suite:

npm test

Code coverage:

istanbul cover node_modules/mocha/bin/_mocha -- -R spec

Issues

If you have any question or doubt, please create an issue.

License

Licensed under the Apache License, Version 2.0.

References

  • API Docs: http://apidocs.cloudfoundry.org/
  • Developer list: https://lists.cloudfoundry.org/archives/list/[email protected]/
  • PWS Console: https://console.run.pivotal.io
  • Bluemix Console: https://console.ng.bluemix.net/
  • PWS Forum: https://support.run.pivotal.io/forums
  • Bluemix Forum: https://developer.ibm.com/answers/
  • CF for Beginners: From Zero to Hero http://slides.cf-hero.cloudcredo.io/