You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-router-multiguard

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-router-multiguard

Provides the ability to specify multiple guards for vue routes

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
24K
2.73%
Maintainers
1
Weekly downloads
 
Created
Source

Vue Router Multiguard Build Status

Provides the ability to specify multiple guards for vue router routes.

Installing

npm install vue-router-multiguard

Notes

  • Guards are executed serially in the order they are supplied.
  • Guard execution will stop when all passed guards are executed OR when any guard calls next() with an argument other than undefined.
  • When a guard calls next() with an argument other than undefined, that argument will be passed to VueRouter.

Usage

multiguard(function[] guards) -> function(to, from, next) {... }

import VueRouter from 'vue-router';
import multiguard from 'vue-router-multiguard';

const guard1 = function(to, from, next) {
    console.log('guard1 called');
    next();
}

const guard2 = function(to, from, next) {
    console.log('guard2 called');
    next();
}

const router = new VueRouter({
    routes: [
        {
            name: 'home',
            path: '/',
            component: {},
            beforeEnter: multiguard([guard1, guard2]),
        }
    ]
});

Running the tests

npm test

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

vue-router

FAQs

Package last updated on 03 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.