Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hapiness/config

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapiness/config - npm Package Compare versions

Comparing version 1.0.0-beta.3 to 1.0.0-beta.4

2

package.json

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

{"name":"@hapiness/config","version":"1.0.0-beta.3","description":"Configuration Library to use it inside Hapiness framework or standalone","main":"index.js","types":"index.d.ts","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/hapinessjs/config.git"},"keywords":["config","yml","node-config","Hapiness","Framework","NodeJS","Node","ES2015","ES2016","ES2017","ES6","ES7","ES8","Typescript"],"contributors":[{"name":"Julien Fauville","url":"https://github.com/Juneil"},{"name":"Antoine Gomez","url":"https://github.com/antoinegomez"},{"name":"Sébastien Ritz","url":"https://github.com/srz09"},{"name":"Nicolas Jessel","url":"https://github.com/njl07"}],"license":"SEE LICENSE IN https://github.com/hapinessjs/hapiness/blob/master/LICENSE.md","bugs":{"url":"https://github.com/hapinessjs/config/issues"},"homepage":"https://github.com/hapinessjs/config#readme","dependencies":{"@types/config":"^0.0.32","@types/node":"^7.0.18","config":"^1.26.1","debug":"^2.6.6","js-yaml":"^3.8.4","rxjs":"^5.4.0"},"engines":{"node":">=7.0.0"}}
{"name":"@hapiness/config","version":"1.0.0-beta.4","description":"Configuration Library to use it inside Hapiness framework or standalone","main":"index.js","types":"index.d.ts","private":false,"repository":{"type":"git","url":"git+ssh://git@github.com/hapinessjs/config.git"},"keywords":["config","yml","node-config","Hapiness","Framework","NodeJS","Node","ES2015","ES2016","ES2017","ES6","ES7","ES8","Typescript"],"contributors":[{"name":"Julien Fauville","url":"https://github.com/Juneil"},{"name":"Antoine Gomez","url":"https://github.com/antoinegomez"},{"name":"Sébastien Ritz","url":"https://github.com/srz09"},{"name":"Nicolas Jessel","url":"https://github.com/njl07"}],"license":"SEE LICENSE IN https://github.com/hapinessjs/config/blob/master/LICENSE.md","bugs":{"url":"https://github.com/hapinessjs/config/issues"},"homepage":"https://github.com/hapinessjs/config#readme","dependencies":{"@types/config":"^0.0.32","@types/node":"^7.0.18","config":"^1.26.1","debug":"^2.6.6","js-yaml":"^3.8.4","rxjs":"^5.4.0"},"engines":{"node":">=7.0.0"}}

@@ -62,4 +62,4 @@ <img src="http://bit.ly/2mxmKKI" width="500" alt="Hapiness" />

"dependencies": {
"@hapiness/core": "^1.0.0-beta.3",
"@hapiness/config": "^1.0.0-beta.3",
"@hapiness/core": "^1.0.0-beta.4",
"@hapiness/config": "^1.0.0-beta.4",
//...

@@ -98,3 +98,3 @@ }

my:
config: test
baseUrl: 'test'
```

@@ -105,24 +105,50 @@

```javascript
import { Config } from '@hapiness/config';
// external-module.ts
import {
HapinessModule,
CoreModuleWithProviders,
InjectionToken,
Inject,
Optional,
} from '@hapiness/core';
Config.load(); // Load config, see node-config => must be loaded only one time, do it inside main module
const CONFIG = new InjectionToken('config');
interface Config {
baseUrl: string;
}
@HapinessModule({
@HapinessModule({
...
})
class ModuleNeedData {
static setConfig(config: MyConfig): CoreModuleWithProviders {
export class ExternalModule {
static setConfig(config: Config): CoreModuleWithProviders {
return {
module: ModuleNeedData,
providers: [{ provide: MyConfig, useValue: config }]
module: ExternalModule,
providers: [{ provide: CONFIG, useValue: config }]
};
}
constructor(@Optional() config: MyConfig) {
...
}
}
export class Service {
constructor(@Optional() @Inject(CONFIG) config) { // @Optional to not throw errors if config is not passed
...
}
}
```
```javascript
// main-module.ts
import {
HapinessModule,
} from '@hapiness/core';
import { ExternalModule } from 'external-module';
import { Config } from '@hapiness/config';
Config.load(); // Load config, see node-config
@HapinessModule({
...
imports: [ ModuleNeedData.setConfig(Config.get('my')) ]
imports: [ ExternalModule.setConfig(Config.get('my')) ]
})

@@ -136,2 +162,7 @@ ...

* v1.0.0-beta.4 (2017-05-15)
* Latest packages versions
* Fix phony scripts
* Documentation.
* Module version related to core version.
* v1.0.0-beta.3 (2017-05-11)

@@ -138,0 +169,0 @@ * Create `Config` module.

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