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

geoip2-library

v1.0.0

Published

An Angular 2-4 library that get IP, city, country and other user information from GeoIP Maxmind API

Downloads

13

Readme

geoip2Library

An Angular 2-4 library that get IP, city, country and other user information from GeoIP Maxmind API

Create our package > Now for the good stuff. Run npm run packagr, and once the process is complete you?ll find a dist folder in your project root. This is your component library. Fully self sufficient, packaged according to best practices, and ready to shine it?s red header-y light upon the world.

Pack it for local development > Let?s get a tarball setup that we can npm install from Angular applications within our local dev environments. cd into the dist folder and run npm pack. This will create a file in the root of the dist folder called my-component-library-0.0.0.tgz. The 0.0.0 part comes from the top of your package.json. You?ll want to keep bumping that up as you start to truly deploy your component library for consumption.

From other Angular applications on your system that require your component library, you can npm install ../some-relative-path/dist/my-component-library-0.0.0.tgz to install your component library into your application.

Publish it on npm > Once you login to your npm account with npm login you can publish your component library with npm publish dist. Just be sure that you have a unique package name (hint: my-component-library may be taken). Once published, you?ll be able to install your component library from npm with npm install my-component-library.

Consuming your component library > Once installed, you can import your header component into any application?s app.module.ts, by including it in its @NgModule imports array?

import { HeaderModule } from 'my-package-name'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, HeaderModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } And using its selector in a template as you would a component that is part of your application.

This library is generated based on the Nikolas LeBlanc tutorial: https://medium.com/@nikolasleblanc/building-an-angular-4-component-library-with-the-angular-cli-and-ng-packagr-53b2ade0701e