Socket
Socket
Sign inDemoInstall

@ghii/http-loader

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ghii/http-loader - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

package.json
{
"name": "@ghii/http-loader",
"version": "0.0.7",
"version": "0.0.8",
"description": "A Funny http loader for ghii configuration manager ",

@@ -5,0 +5,0 @@ "maintainers": [

# GHII - HTTP LOADER
TBC
Http loader is a [ghii](https://github.com/iad-os/ghii) loader. It is used to load the configurations of a nodejs application by calling an endpoint which returns a json with the configurations to be injected into the application.
## How to install:
```sh
npm install @ghii/http-loader
```
Configuration in yaml:
```yaml
env: development
app:
version: "0.0.1"
name: "ghii-test"
```
in JSON:
```json
{
"env": "development",
"app": {
"version": "0.0.1",
"name": "ghii-test"
}
}
```
## Usage example:
```TypeScript
import ghii from "@ghii/ghii";
import httpLoader from "@ghii/http-loader";
const options = ghii((T) =>
T.Object({
env: T.Union([T.Literal("development"), T.Literal("production")], {
default: "development",
}),
app: T.Object(
{
name: T.String({ default: "test" }),
version: T.String(),
},
{ additionalProperties: false, default: {} }
),
})
).loader(
//example url http://localhost:4000/.wellknown.json
httpLoader(process.env.WELLKNOWN_URL!, {
throwOnError: process.env.NODE_ENV !== 'development', //silent mode
logger: (err, msg) => {
if (err) {
customLogger.error(err, msg);
} else {
customLogger.debug(msg);
}
},
})
);
export default options;
```
## Related
- [ghii](https://github.com/iad-os/ghii)
- [ghii-yaml-loader](https://github.com/iad-os/ghii-yaml-loader)
- [ghii-envs-loader](https://github.com/iad-os/ghii-envs-loader)
- [ghii-package- json-loader](https://github.com/iad-os/ghii-package-json-loader)
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