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

nativescript-nbmaterial-coordinator

v1.0.0

Published

A nativescript implementation of coordinator between layout for iOS and Android

Readme

Nativescript implementation of coordination between views

The module implements coordination for both platforms iOS and Android. It uses a producer/consumer pattern based on rxJs.

The module augment nativescript view in order to add behaviours:

    interface View {
        addBehaviour(behaviour: Behaviour);
    } 


export interface Behaviour {
    view: View;
    onCreate?();
    onInitNative?();
    onDispose?();
    onLoaded?();
    onUnloaded?();
}

It also provide a Producer interface. The producer is the view that make other views moving (for example a scroll event on scroll view):

export interface Producer {
    init();
    start();
    stop();
    stream: Rx.Subject<ProducerData>;
}

The module provide some behaviours. But you can create your own behaviours.

Below the list of behaviour based on a scrollview (or listview):

  • FixedHeaderBehavior : hide/show (using translation and opacity) a header based on scroll position
  • ExpandableHeaderBehavior: augment the height of the header or reduce it based on scroll position
  • ScrollScaleBehavior: scale or unscale a view based on scroll position
  • AnchorBehaviour : the textinput is anchored to the top, bottom, middle when keyboard is shown. The input stay anchored even if autogrow is setup

FixedHeaderBehavior

let header: View = null;
let listView: ListView = null;
let behav = new FixedHeaderBehavior(listView);
behav.height = 112;
behav.speedFactor = 1; //HOW MUCH INCREASE OR DECREASE SIZE OF HEADER RELATIVE TO DELTA SCROLL
behav.deferHideFactor = 3; //START HIDING ONLY IF SCROLL IS 3 TIMES GREATER THAN HEADER HEIGHT
behav.deferShowFactor = 1;//START SHOWING ONLY IF SCROLL IS 1 TIMES GREATER THAN HEADER HEIGHT
behav.playOpacity = false; //PLAY WITH HEADER OPACITY WHEN HIDING
behav.maxTranslate = 56;//MAXIMUM TRANSLATION VALUE APPLIED TO HEADER
behav.thresholdFactor = 0.3;//IF HEADER HAS 1/3 OF HIS HEIGHT HIDDEN (SHOWN)=> SO PLAY ANIMATION TO HIDE (SHOW) ALL
header.addBehaviour(behav);

ScrollScaleBehavior

let btn: Button = null;
let listView: ListView = null;
    let behavBtn = new ScrollScaleBehavior(listView);
    behavBtn.height = 56;//HEIGHT OF BUTTON
    behavBtn.deferHideFactor = 3;//START HIDING ONLY IF SCROLL IS 3 TIMES GREATER THAN HEADER HEIGHT
    behavBtn.deferShowFactor = 1;//START SHOWING ONLY IF SCROLL IS 1 TIMES GREATER THAN HEADER HEIGHT
    btn.addBehaviour(behavBtn);

ExpandableHeaderBehavior

let headerImage: Image = null;
let scrollview: ScrollView = null;
let behav = new ExpandableHeaderBehavior(scrollview);
    behav.height = 400; //MAXIMUM HEIGHT OF THE IMAGE
    behav.disappearAt = 56 + page.getStatusBarHeightDip();//HIDE IMAGE WHEN HEIGHT IS UNDER
    behav.showAnimation = (ex) => {//PLAY AN ANIMATION WHEN SHOWN
        appbar.animate({ backgroundColor: new Color("transparent"), duration: ex.animationDuration, curve: AnimationCurve.easeOut });
    };
    behav.hideAnimation = (ex) => {//PLAY AN ANIMATION WHEN HIDDEN
        appbar.animate({ backgroundColor: new Color("purple"), duration: ex.animationDuration, curve: AnimationCurve.easeIn });
    };
    headerImage.addBehaviour(behav);
<Image src="~/img/logo.png" id="headerImage" stretch="aspectFill" height="400" verticalAlignment="top"/>
<app:AppBarLayout columns="auto,*,auto,auto" rows="auto" id="actionbar">
    <app:AppBarIcon text="list" col="0"/>
    <app:AppBarTitle text="My Application" col="1"/>
    <app:AppBarIcon text="notifications" col="2" />
    <app:AppBarIcon text="search" col="3" tap="openSearch"/>
</app:AppBarLayout> 

AnchorBehaviour

The TextLayout is augmented. This make this new property available:

export interface TextLayout{
    anchor:"bottom"|"middle"|"top"|"visible";
} 
<TextLayout anchor="bottom">
    ...
</TextLayout> 

See all modules here