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

@blinfo/authjs

v0.1.5

Published

Javascript library, meant for browser use, to authenticate and authorize users against Björn Lundén Information

Readme

Blinfo Authjs

A javascript library, meant for browser use, to authenticate and authorize users against Björn Lundén Information.

Installation

npm install @blinfo/authjs

For vanilla javascript projects

Load script

<script src="blauth-min.js" type="text/javascript"></script>

Initialize

BLAuth.init({ clientId: 'your-client-id', redirectURI: 'your-redirect-url', scopes: ['requested-scope']});
BLAuth.getLoginStatus((res) => {
    console.log('Logged in user:' + res.name);
});

Init option params

  • clientId: string - The id of registrated client at BL.
  • redirectURI: string - Registrated redirect URL.
  • scopes: stringarray (optional) - Requested scopes. If no scope is provided, then the id scope USER_IDENTITY will be used.
  • returnURL: string (optional) - Return URL.
  • width: number (optional) - Width of login popup.
  • height: number (optional) - Height of login popup.
  • env: string (optional) - Environment (dev, test or empty for production).

Login

BLAuth.login((res) => {
    console.log('Logged in user:' + res.name);
});

Response

export interface BLUser {
    name: string;
    firstName: string;
    lastName: string;
    email: string;
    userName: string;
    authToken: string;
}

Logout

BLAuth.logout(res => {
    console.log("User logged out");
});

For Angular projects

Create a service and make sure the service is loaded at the redirect url.

import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import * as blauth from '@blinfo/authjs';

@Injectable()
export class Auth2Service {

    private _authState: BehaviorSubject<blauth.BLUser> = new BehaviorSubject(null);

    get authState(): Observable<blauth.BLUser> {
        return this._authState.asObservable();
    }
    constructor() {
        blauth.init({ clientId: 'your-client-id', redirectURI: 'your-redirect-url', scope: 'requested-scope' });
        blauth.getLoginStatus((user: blauth.BLUser) => {
            this._authState.next(user);
        });
    }

    login() {
        blauth.login((user: blauth.BLUser) => {
            this._authState.next(user);
        });
    }
    logout() {
        blauth.logout(() => {
            this._authState.next(null);
        });
    }
}

How to build and publish

  1. Clone repo.
  2. Make changes.
  3. Build.
npm run build
  1. Commit changes.
git add .
git commit -m"made some changes."
  1. Update version by typing the command:
npm version [major|minor|patch]
  1. Publish to npm registry.
npm login
npm publish
  1. Push commits AND tag to git.
git push
git push origin vX.X.X

Need more help? https://docs.npmjs.com/getting-started/publishing-npm-packages