Socket
Socket
Sign inDemoInstall

cfenv

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cfenv - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

tests/fixtures/vcap-local-bad.json

32

CONTRIBUTING.md
Contributing
================================================================================
Awesome! I'm happy that you want to contribute.
Awesome! We're happy that you want to contribute.

@@ -12,29 +12,11 @@ Make sure that you're read and understand the [Code of Conduct](CODE_OF_CONDUCT.md).

If you want to modify the source to play with it, you'll also want to have the
`jbuild` program installed.
The following `npm` scripts are available when doing development on this
package:
To install `jbuild`, use the command
* `npm run build` - build the library from the CoffeeScript source
* `npm run serve` - run a test server
* `npm test` - run the tests
* `npm run watch` - watch for source file changes, then `build`, then `test`
```text
npm -g install jbuild
```
The `jbuild` command runs tasks defined in the `jbuild.coffee` file. The
task you will most likely use is `watch`, which you can run with the
command:
```text
jbuild watch
```
When you run this command, the application will be built from source, the server
started, and tests run. When you subsequently edit and then save one of the
source files, the application will be re-built, the server re-started, and the
tests re-run. For ever. Use Ctrl-C to exit the `jbuild watch` loop.
You can run those build, server, and test tasks separately. Run `jbuild`
with no arguments to see what tasks are available, along with a short
description of them.
GitHub usage

@@ -41,0 +23,0 @@ --------------------------------------------------------------------------------

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.12.2
// Generated by CoffeeScript 1.12.7
(function() {

@@ -39,2 +39,5 @@ var AppEnv, URL, _, cfenv, fs, getApp, getBind, getName, getPort, getServices, getURLs, pkg, ports, throwError, yaml;

}
if (this.isLocal) {
this._getVcapFromFile(options);
}
this.app = getApp(this, options);

@@ -49,2 +52,26 @@ this.services = getServices(this, options);

AppEnv.prototype._getVcapFromFile = function(options) {
var contents, err, vcap;
if (!(options != null ? options.vcapFile : void 0)) {
return;
}
contents = null;
try {
contents = fs.readFileSync(options.vcapFile, 'utf8');
} catch (error) {
err = error;
console.log("error reading vcapFile '" + options.vcapFile + "': " + err + "; ignoring");
return;
}
vcap = null;
try {
vcap = JSON.parse(contents);
} catch (error) {
err = error;
console.log("error parsing vcapFile '" + options.vcapFile + "': " + err + "; ignoring");
return;
}
return options.vcap = vcap;
};
AppEnv.prototype.toJSON = function() {

@@ -51,0 +78,0 @@ return {

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.12.2
// Generated by CoffeeScript 1.12.7
(function() {

@@ -3,0 +3,0 @@ var JL, JS, cfenv, generateDump, http;

{
"name": "cfenv",
"main": "./lib/cfenv",
"description": "easy access to your Cloud Foundry application environment",
"version": "1.0.4",
"author": "pmuellr",
"license": "Apache-2.0",
"homepage": "https://github.com/cloudfoundry-community/node-cfenv",
"name": "cfenv",
"main": "./lib/cfenv",
"description": "easy access to your Cloud Foundry application environment",
"version": "1.1.0",
"author": "pmuellr",
"license": "Apache-2.0",
"homepage": "https://github.com/cloudfoundry-community/node-cfenv",
"repository": {
"type": "git",
"url": "https://github.com/cloudfoundry-community/node-cfenv.git"
"type": "git",
"url": "https://github.com/cloudfoundry-community/node-cfenv.git"
},
"scripts": {
"build": "jbuild build",
"serve": "jbuild serve",
"test": "jbuild test",
"watch": "jbuild watch"
},
"dependencies": {
"js-yaml": "3.7.x",
"ports": "1.1.x",
"underscore": "1.8.x"
"js-yaml": "3.11.x",
"ports": "1.1.x",
"underscore": "1.8.x"
},
"devDependencies": {
"coffee-script": "1.12.x",
"mocha": "3.2.x",
"expect.js": "0.3.x"
"coffeescript": "1.12.x",
"expect.js": "0.3.x",
"jbuild": "1.0.x",
"mocha": "5.1.x"
}
}

@@ -46,3 +46,5 @@ cfenv - easy access to your Cloud Foundry application environment

it will provide useful values when you're running in Cloud Foundry AND
when you're running locally.
when you're running locally. You can supply local versions of
`VCAP_SERVICES` and/or `VCAP_APPLICATION` by using the `vcap` and `vcapFile`
options described below.

@@ -93,2 +95,12 @@

* `vcapFile` - provide the same function as the `vcap` option, but instead of
setting the option value to an object, you set it to the name of a JSON
file, which will be parsed and used as the `vcap` option value is used,
as described above.
When both `vcap` and `vcapFile` options are provided, the values in `vcap`
are ignored.
This option property is ignored if not running locally.
This function returns an object with the following properties:

@@ -316,2 +328,8 @@

**1.1.0** - 2018/04/18
- add the `vcapFile` option - [issue #31][]
[issue #31]: https://github.com/cloudfoundry-community/node-cfenv/issues/31
**1.0.4** - 2017/01/13

@@ -348,2 +366,9 @@

contributing
================================================================================
See the [CONTRIBUTING.md](CONTRIBUTING.md) doc for more information on
contributing to this project.
license

@@ -350,0 +375,0 @@ ================================================================================

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc