# @steveylin/ng2-configure

Latest version **0.0.8** (published 2020-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @steveylin/ng2-configure
pnpm add @steveylin/ng2-configure
yarn add @steveylin/ng2-configure
bun add @steveylin/ng2-configure
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2020-03-15 |
| First published | 2020-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 143.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | steveylin |
| Keywords | angular, front-end, typescript, web |

## Links

- npm: https://www.npmjs.com/package/@steveylin/ng2-configure
- npm.io page: https://npm.io/package/@steveylin/ng2-configure

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2020-03-15
- 0.0.7 — 2020-03-15
- 0.0.6 — 2020-03-01
- 0.0.5 — 2020-03-01
- 0.0.4 — 2020-03-01
- 0.0.3 — 2020-03-01
- 0.0.2 — 2020-03-01

## README

<p align="center">
  <a href="#">
    <img src="https://i.imgur.com/1xlpNX1.png" alt="Steve Y Lin logo" width="72" height="72">
  </a>
</p>

<h3 align="center">Steve Y Lin</h3>

<p align="center">
  Powerful full stack library for faster and easier development.
  <br>
  <strong>@steveylin/ng2-configure</strong>
  <br>
  <br>
  <a href="#">Report bug</a>
  ·
  <a href="#">Request feature</a>
</p>


## Table of contents

- [Usage](#usage)
- [Status](#status)
- [Copyright and license](#copyright-and-license)


## Usage

### Install package

```
npm i @steveylin/ng2-configure --save
```

### Add into module to preload configure file

**For example**

```File: app.module.ts```

```typescript
...
import { ConfigureModule, ConfigureLoader } from '@steveylin/ng2-configure';

/**
 * Main App Module
 */
@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    // Use 'forRoot' to preload configure file you want
    ConfigureModule.forRoot(
      {
        key: 'datasources',
        path: './../assets/configs/datasources.json'
      }
    ),
    HttpClientModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

```

```File: app.component.ts```

```typescript
...
import { ConfigureLoader } from '@steveylin-libs/configure';

/**
 * Main App Component
 */
@Component({
  selector: 'steveylin-libs-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit {

  /**
   * @param configureLoader Configure load files service
   */
  constructor(private configureLoader: ConfigureLoader) {}

  /**
   * Initilailize component
   *
   * @method public
   */
  public ngOnInit(): void {
    const config = this.configureLoader.get<AppConfig>('datasources');
    console.log(config.mqtt);
  }

}

```

### Preview

<img src="https://imgur.com/GUMNcqx.png">

## Status

[![npm version](https://img.shields.io/npm/v/@steveylin/ng2-configure)](https://www.npmjs.com/package/@steveylin/configure)
[![type](https://img.shields.io/npm/types/@steveylin/ng2-configure)](https://www.npmjs.com/package/@steveylin/configure)

## Copyright and license

Code and documentation copyright 2020 Steve Y Lin.

---
_Source: https://npm.io/package/@steveylin/ng2-configure · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
