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-bdir

v0.1.1

Published

A bidirectional support library for angular

Readme

Ngx-Bdir

A bidirectional support lib for angular

Project policies and statuses

Build Status coverage: lines coverage: functions coverage: branches coverage: statements

Getting Started

Installation

install with npm:

npm install ngx-bdir --save

Usage

  1. Import the BDirModule:

    import {BrowserModule} from '@angular/platform-browser';
    import {NgModule} from '@angular/core';
    import { BDirModule } from 'ngx-bdir';
       
    @NgModule({
        imports: [
            BrowserModule,
            BDirModule
        ],
        bootstrap: [AppComponent]
    })
    export class AppModule { }
  2. Add bdir directive In the application wrapper:

    <div id="app-wrapper" bdir> 
      <h1>
          Welcome to {{ title }}!
      </h1>
      <router-outlet></router-outlet>
    </div>
  3. Start using scss mixins:

    
    @import "~ngx-bdir/styles/bdir.mixins";
    h1 {
      color: darkslategray;
      @include padding-start(20px);
    }

    Now the h1 element will transpile to:

    h1 {
      color: darkslategray;
    }
    *[dir=ltr] h1 {
      padding-right: 20px; }
        
    *[dir=rtl] h1 {
      padding-left: 20px; }

API

####BDirService #####Methods: *setLang(lang: Lang) - Setting the current language which will determine the direction value

*setDir(dir: Direction) - Set the current direction value.

*getDir$(): Observable<Direction> - Get the current direction value as observable.

*setLang(lang: Lang) - Get the opposite direction value as observable.

####BDirDirective bdir: 'start' | 'end' - Will set a dir attribute to the hosting element with rtl | ltr value accordingly start, is the default value.

  <element bdir="start"></element>

####Tokens RTL_LANGUAGES - Define which language will consider as rtl languages, default value: ['he', 'ar', 'hy', 'dv', 'ff', 'ku', 'fa'].

DEFAULT_LANG - Define the default language, default value: 'en'

####Mixins

All mixins were written following to the css syntax, simply change left & right with start & end.

Also the mixins were developed in a way that the transpiled code will be as minimal as possible.

*$encapsulation property used for inner components to be affected by their host's direction by using angular's :host-context

padding-start($padding, $encapsulation: true)

padding-end($padding, $encapsulation: true)

margin-start($margin, $encapsulation: true)

margin-end($margin, $encapsulation: true)

float($start: true, $encapsulation: true)

dir($start: true, $encapsulation: true)

text-align($start: true, $encapsulation: true)

start($value, $encapsulation: true)

end($value, $encapsulation: true)

transformTranslate($x, $y: 0, $encapsulation: true)

transformScale($x, $y: 1, $encapsulation: true)

mirror($encapsulation: true)