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

appsettings-json-reader

v2.0.2

Published

appsettings-json-reader is a JavaScript package that allows you to easily and efficiently read appsettings.json configuration files.

Downloads

48

Readme

appsettings-json-reader

Visit Youtube Channel DacarSoft →DacarSoft

English

appsettings-json-reader is a package for reading the appsettings.json file located in the root directory of an Angular or NestJS project. It provides an alternative to using environment files.

Installation

npm i appsettings-json-reader

Usage

To use appsettings-json-reader, first import the AppSettings class from the package:

import { AppSettings } from 'appsettings-json-reader';

Next, call the readAppSettings() method on the AppSettings class to read the appsettings.json file:

const appSettings = AppSettings.readAppSettings();

Example in Angular

YouTube Video

import { Component, OnInit } from '@angular/core';
import { AppSettings } from 'appsettings-json-reader';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  appSettings: any = AppSettings.readAppSettings();

  ngOnInit() {
    console.log(this.appSettings.appName); // prints "My Application"
    console.log(this.appSettings.apiEndpoint); // prints "https://myapi.com"
  }
}

Example in NestJS

import { Injectable } from '@nestjs/common';
import { AppSettings } from 'appsettings-json-reader';

@Injectable()
export class AppService {
  appSettings: any = AppSettings.readAppSettings();

  getHello(): string {
    console.log(this.appSettings.appName); // prints "My Application"
    console.log(this.appSettings.apiEndpoint); // prints "https://myapi.com"
    return this.appSettings.appName;
  }
}

Contributing

If you want to contribute to appsettings-json-reader, please submit a pull request. All contributions are welcome!

License

MIT


appsettings-json-reader

Visita el canal de Youtube DacarSoft →DacarSoft

Español

appsettings-json-reader es un paquete para leer el archivo appsettings.json ubicado en el directorio raíz de un proyecto Angular o NestJS. Proporciona una alternativa al uso de archivos de entorno.

Instalación

npm i appsettings-json-reader

Uso

Para usar appsettings-json-reader, primero importa la clase AppSettingsdel paquete:

import { AppSettings } from 'appsettings-json-reader';

A continuación, llama al método readAppSettings() en la clase AppSettings para leer el archivo appsettings.json:

const appSettings = AppSettings.readAppSettings();

Ejemplo en Angular

YouTube Video

import { Component, OnInit } from '@angular/core';
import { AppSettings } from 'appsettings-json-reader';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  appSettings: any = AppSettings.readAppSettings();

  ngOnInit() {
    console.log(this.appSettings.appName); // prints "My Application"
    console.log(this.appSettings.apiEndpoint); // prints "https://myapi.com"
  }
}

Ejemplo en NestJS

import { Injectable } from '@nestjs/common';
import { AppSettings } from 'appsettings-json-reader';

@Injectable()
export class AppService {
  appSettings: any = AppSettings.readAppSettings();

  getHello(): string {
    console.log(this.appSettings.appName); // prints "My Application"
    console.log(this.appSettings.apiEndpoint); // prints "https://myapi.com"
    return this.appSettings.appName;
  }
}

Contribuir

Si deseas contribuir a appsettings-json-reader, envía una solicitud de extracción (pull request). ¡Todas las contribuciones son bienvenidas!

License

MIT