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 🙏

© 2024 – Pkg Stats / Ryan Hefner

navs

v0.0.7

Published

nav menu

Downloads

6

Readme

usage

<link rel="stylesheet" href="./index.css">

<div class="menu-wrapper">
  <span id="toggle-bar"><i class="fa fa-bars"></i></span>
  <ul class="menu-list"></ul>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="./index.js"></script>

<script >
$(function () {

  var options = {
    data: [
      {authid: 1, pid: null, name: 'node', value: null, icon: 'fa-globe'},
      {authid: 2, pid: null, name: 'facebook', value: null, icon: 'fa-gear'},
      {authid: 3, pid: null, name: 'google', value: null, icon: 'fa-gears'},
      {authid: 4, pid: 1, name: 4, value: 'https://nodejs.org/', icon: 'fa-globe'},
      {authid: 5, pid: 2, name: 5, value: 'https://facebook.github.io/react/', icon: 'fa-globe'},
      {authid: 6, pid: 3, name: 6, value: 'https://angular.io/tutorial', icon: 'fa-globe'},
      {authid: 7, pid: 1, name: 7, value: 'https://angular.io/guide/quickstart', icon: 'fa-globe'},
      {authid: 8, pid: 2, name: 8, value: 'https://angular.cn/guide/quickstart', icon: 'fa-globe'},
      {authid: 9, pid: 3, name: 9, value: 'https://angular.cn/translations/cn/home', icon: 'fa-globe'},
      {authid: 10, pid: 3, name: 10, value: 'https://angular.cn/features', icon: 'fa-globe'},
      {authid: 11, pid: 8, name: 11, value: 'https://angular.cn/docs', icon: 'fa-globe'},
      {authid: 12, pid: 7, name: 12, value: 'https://angular.cn/resources', icon: 'fa-globe'},
      {authid: 13, pid: 6, name: 13, value: 'https://angular.cn', icon: 'fa-globe'},
      {authid: 14, pid: 6, name: 14, value: 'https://www.github.com/angular/angular', icon: 'fa-globe'},
      {authid: 15, pid: 5, name: 15, value: 'https://angular.io/features', icon: 'fa-globe'},
      {authid: 16, pid: 4, name: 16, value: 'https://angular.io/events', icon: 'fa-globe'},
      {authid: 17, pid: 10, name: 17, value: 'https://angular.io/resources', icon: 'fa-globe'},
      {authid: 18, pid: 10, name: 18, value: 'https://angular.io/api', icon: 'fa-globe'},
      {authid: 19, pid: 10, name: 19, value: 'https://angular.io/docs', icon: 'fa-globe'},
      {authid: 20, pid: 19, name: 20, value: 'https://angular.io/cli', icon: 'fa-globe'},
      {authid: 21, pid: 19, name: 21, value: 'https://angular.io/cli/add', icon: 'fa-globe'},
      {authid: 22, pid: 19, name: 22, value: 'https://angular.io/cli/build', icon: 'fa-globe'},
      {authid: 23, pid: 22, name: 23, value: 'https://angular.io/lint', icon: 'fa-globe'},
      {authid: 24, pid: 22, name: 24, value: 'https://angular.io/cli/new', icon: 'fa-globe'},
      {authid: 25, pid: 24, name: 25, value: 'https://angular.io/cli/run', icon: 'fa-globe'},
    ]
  };

  $('.menu-list').navs(options);

  // OR

  // navs(options);

  // OR

  // $('.menu-list').navs(Object.assign({}, options, {
  //   selector: '.menu-list',
  //   primaryKey: 'authid',
  //   parentId: 'pid',
  //   text: 'name',
  //   container: '.menu-wrapper'
  // }));

  // OR

  // navs(Object.assign({}, options, {
  //   selector: '.menu-list',
  //   primaryKey: 'authid',
  //   parentId: 'pid',
  //   text: 'name',
  //   container: '.menu-wrapper'
  // }));



  // If you want to select a menu item, you can call the select method.

  // $('.menu-list').navs.select('https://angular.io/cli/new');
  // OR
  // navs.select('https://angular.cn/resources');

});
</script>

navs options

All options are customizable.

  var defaults = {
    selector: '.menu-list', // The container you want to place the menu.
    primaryKey: 'authid', // {authid: 1, pid: null, name: 'node', ...}.authid
    parentId: 'pid', // {authid: 1, pid: null, name: 'node', ...}.pid
    text: 'name', // {authid: 1, pid: null, name: 'node', ...}.name
    container: '.menu-wrapper', // the outer container of menu
    mini: { // toggle small screen
      toggle: {
        id: '#toggle-bar',
        className: 'mini-toggle'
      },
      wrapperClass: 'mini-wrapper'
    },
    step: { // style.paddingLeft
      dataName: 'step',
      min: 15,
      max: 20
    },
    levelOne: { // Used to distinguish menu levels
      dataName: 'level',
      selectedClass: 'level-1-selected'
    },
    itemSelected: {
      defaultClass: 'menu-selected', // Not first level menu style(submenu item style)
      animatedClass: 'rotate-90' // for options.arrow
    },
    arrow: {
      baseClass: 'menu-icon fa ',
      defaultClass: 'bars',
      rightClass: 'fa-chevron-right',
      moreBase: 'menu-more fa '
    },
    items: { // recommend different elements
      item: 'a', // If it is not an a element, then clicking on the element will not jump to the new page.
      itemParent: 'li',
      itemWrapper: 'ul'
    },
    data: []
  };