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

ns-vue-nami

v0.1.0-alpha.3

Published

Router companion for Nativescript-Vue 2.0's Manual Routing.

Downloads

29

Readme

ns-vue-nami CircleCI

Router companion for Nativescript-Vue 2.0's Manual Routing.

Yep, that's her, Nami from One Piece. Why? Coz she's a navigator.

Installation

npm

npm install ns-vue-nami

yarn

yarn add ns-vue-nami

Recommended Implementation

Create a router folder with an index.js file within your app folder.

app
|- components
|- router
   |- index.js

index.js

import Vue from 'nativescript-vue';
import NsVueNami from 'ns-vue-nami';
import login from '~/components/login';
import dashboard from '~/components/dashboard';
import isAuthenticated from 'some-authentication-module';

Vue.use(NsVueNami);

const vm = new Vue();

vm.$nami.authGuard((next) => {
  if(isAuthenticated) {
    next();
  } else {
    next('login');
  }
});

// register all routes here.
vm.$nami.init({
  routes: [
    {
      name: 'login',
      component: login,
      noAuth: true,
      entry: !isAuthenticated
    },
    {
      name: 'dashboard',
      component: dashboard,
      entry: isAuthenticated
    }
  ]
});

main.js

Just invoke the router in your main.js.

import entry from './router';

new Vue({
  store,
  render: h => h('frame', [h(entry)])
}).$start();

Sample Usage

From the template

<button @tap="$nami.navigate('foo')">Go to foo</button>

From script

export default {
  methods: {
    someFunc() {
      this.$nami.navigate('bar');
    }
  }
}

API

.init()

Sets all the routable components across the whole app. Returns the entry component to be used in main.js as frame entry.

Router properties:

  1. name: String - The component name of your choice.
  2. component: Vue component - The vue component.
  3. noAuth: Boolean: default - false - The component will NOT require authentication if set to true.
  4. entry: Boolean - Set a particular component as entry point.
import login from '~/components/login';
import dashboard from '~/components/dashboard';

vm.$nami.init({
  routes: [
    {
      name: 'login',
      component: login,
      entry: true
    },
    {
      name: 'dashboard',
      component: dashboard
    }
  ]
})

.authGuard()

Will decide whether the component is routable or not based on authentication status.

import Vue from 'nativescript-vue';
import NsVueNami from '../plugins/ns-vue-nami';

import login from '~/components/login';
import dashboard from '~/components/dashboard';

// Dummy authentication status.
const isAuthenticated = true;

Vue.use(NsVueNami);

const vm = new Vue();

vm.$nami.authGuard((next) => {
  if(isAuthenticated) {
    next();
  } else {
    next('login');
  }
});

export default vm.$nami.init({
  routes: [
    {
      name: 'login',
      component: login,
      noAuth: true,
      entry: !isAuthenticated // login will be the entry if isAuthenticated is false
    },
    {
      name: 'dashboard',
      component: dashboard,
      entry: isAuthenticated // dashboard will be the entry if isAuthenticated is true
    }
  ]
});

.register()

Adds a new route to the list of routes on the fly.

import cat from '~/components/cat';

vm.$nami.register({name: 'cat', component: cat});

.navigate()

// Basic
this.$nami.navigate('cat-component');

// With props
this.$nami.navigate('cat-component', {name: 'Kidlat', color: 'Black'});
<button @tap="$nami.navigate('cat-component', {name: 'Kidlat', color: 'Black'})">View Cat</button>

.modal()

Just like .navigate() but shows the component on a modal.

// Basic
this.$nami.modal('cat-component');

// With props
this.$nami.modal('cat-component', {name: 'Kidlat', color: 'Black'});
<button @tap="$nami.modal('cat-component', {name: 'Kidlat', color: 'Black'})">View Cat in a Modal</button>

.back()

Goes back to the previous component.

this.$nami.back();
<button @tap="$nami.back()">Go back</button>