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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ngx-axios-adapter/core

v1.0.6

Published

Axios adapter for Angular 6+

Readme

NgxAxiosAdapter

npm version CircleCI Coverage Status

Axios adapter for Angular 6+

Installing

npm install @ngx-axios-adapter/core

Usage

import { Injectable } from '@angular/core';

@Injectable()
export class ContentService {
  constructor(private readonly axiosAdapter: AxiosAngularAdapterService) {}

  getContent() {
    const response = await axios.get(
      'https://jsonplaceholder.typicode.com/todos/1',
      {
        adapter: this.axiosAdapter.adapter
      }
    );

    return response.data;
  }
}

With contenful

import { createClient } from 'contentful';
import { AxiosAngularAdapterService } from '@ngx-axios-adapter/core';

export class ContentfulService {
  constructor(private readonly axiosAdapter: AxiosAngularAdapterService) {
    createClient({
      // your own config
      space: CONFIG.space,
      accessToken: CONFIG.accessToken,
      // pass the adapter to contentful
      adapter: this.axiosAdapter.adapter
    });
  }
}

Why

We do not recommend using any other Http client in an Angular project other than the one provided by the Angular team. However, if you wish to use Axios in place of the Angular HttpClient, or have an indirect reliance upon Axios, the package will ensure your project is still server-side renderable by making all HTTP calls through the Angular HttpClient.

One such scenario would be using the Contentful JavaScript SDK for retrieving content for your site. The Contentful SDK includes it's own version of Axios which makes all calls to the Contentful services using the standard Node http or https module. You may notice that when you try to server-side render your app, the app is rendered and sent to the browser before the calls to Contentful are complete thereby defeating the purpose of server-side rendering.

While we specifically call out Contentful here, this project is meant as a universal Axios adapter to bridge the gap between Axios and Angular. Feel free to use it in your own projects but you may not see much, if any, benefit unless you are server-side rendering your app.

Contributing

Contributions in the form of pull requests or opened issues are very welcome.

Getting Started

This project makes use of the Angular CLI using Nrwl Nx. To get started, make sure you install these tools globally.

npm i -g @angular/cli
npm i -g @nrwl/schematics

Project Structure

The primary code distributed on NPM can be found in libs/core. All other code, including code in apps, is meant only to support testing and implementation of the library.

Testing

Unit testing is performed using Jest. If you contribute code to the project, you are expected to write tests. Pull requests that lack proper testing will be rejected.

# To execute all tests
npm test

# To execute all tests in watch mode
npm test -- --watch

# To execute a specific test
npm test -- axios-angular-adapter.service.ts

Linting

All code must abide by and pass the linting rules. For the most part, these are the defaults provided for any Angular project so you should be at home in the project. If you believe a change is needed to the lint rules, feel free to open a pull request but be sure to explain the reasoning behind the change.

# To run lint checks
npm run lint

Building

For the most part, the only code you should ever need to build would be in libs/core. However, building will typically only be necessary for releases.

# To build the core lib
npm run build