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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-paris

v0.0.8

Published

## 依賴於 - @angular/common - @angular/core

Readme

NGX-PARIS

###目前為0.0.6 持續更新中...

依賴於

  • @angular/common
  • @angular/core

安裝

npm install --save ngx-paris

Import在主要module

import { NgxParisModule } from 'ngx-paris';
@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    NgxParisModule
  ])
export class AppModule { }

設置功能

  1. HttpDefaultOptions

    • baseApiURL(string): 呼叫API的domain url
    • headers(object): 預先載入的headers
  2. HttpRquestOptions

    • baseURL(string): 如有設定,則覆蓋baseApiURL
    • headers(object): 設定request http headers, 會合併預先載入的headers
    • queryObject(object): query string的物件型態
    • body(object): body
  3. JWTOptions

    • key: 設定要讀取token在localstorage的key是為何
  4. ConfigOptions

    • configURL: config檔的位置(*.json)

設置功能的值都可以覆寫,然後註冊在providers

export class AppHttpDefaultOptions extends HttpDefaultOptions {
  baseApiURL = 'https://test_api.com/';
  headers = {
    ['api-version']: '1.0'
  };
}

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxParisModule
  ],
  providers: [{
    provide: HttpDefaultOptions,
    useClass: AppHttpDefaultOptions
  }],
  bootstrap: [AppComponent]
})
export class AppModule { }

注入服務

  1. Storage:
    import { Storage } from 'ngx-paris';
    @Component({ selector: 'app-root', templateUrl: './app.component.html' })
    export class AppComponent implements OnInit {
    constructor(private stotage: Storage) {}
        ngOnInit(): void {
            this.stotage.get('key'); // 讀取localStorage
            this.stotage.set('key', obj); // 存放localStorage
            this.stotage.clear(); // 清除localStorage所有內容
        }
    }
  2. Logger:
     import { Logger } from 'ngx-paris';
     @Component({ selector: 'app-root', templateUrl: './app.component.html' })
     export class AppComponent implements OnInit {
     constructor(private logger: Logger) {}
     ngOnInit(): void {
         // logger有以下六種方式可以使用
         this.logger.debug('message', 'message2', 'message3'); // 訊息可以串接, 輸出為 DEBUG: message message2 message 3
         this.logger.trace('message');
         this.logger.info('message');
         this.logger.warn('message');
         this.logger.error('message');
         this.logger.fatal('message');
         }
     }
    
    
  3. Config:
     import { Config } from 'ngx-paris';
     @Component({ selector: 'app-root', templateUrl: './app.component.html' })
     export class AppComponent implements OnInit {
     constructor(private config: Config) {}
         ngOnInit(): void {
             this.config.data(); // 讀取config所有內容
             this.config.get('key'); // 針對config的欄位讀取
         }
     }
    

String擴充方法

  1. toInt(radix?: number): number;
  2. toFloat(): number;
  3. toDate(): Date;
  4. toURL(base: string): string;