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

breadcrumbmanager

v1.1.3

Published

Built to keep a previous path history of anything. Done in JavaScript.

Downloads

11

Readme

breadcrumbmanager

Built as a way to track the previous history of anything and navigate back and forth through it in JavaScript.

Universal module defined to be used with requirejs, node, commonjs, or global scoped if no module loader is used.

  • All files in the dist folder are minified for production use.
  • All files in the src directory are the source code for development use.
  • Packages point at the dist minified code with source maps.
  • nodejs
  • npm install
  • npm install -g gulp

gulp test

Each process is dependent upon the previous. If one fails the build process exits.

  • gulp
  • gulp test (Unit specifications)
  • gulp build (Test, folder clean-ups, minification, source maps, renaming)
  • gulp deploy (Test, build, versioning)

npm: npm install breadcrumbmanager bower: bower install breadcrumbmanager

var bcm = new BreadcrumbManager(5);

bcm.add('1');
bcm.add('2');
bcm.add('3');
bcm.add('4');
console.log('Breadcrumbs list: ' + bcm._breadcrumbs);

var breadcrumb = bcm.prev();
breadcrumb = bcm.prev();
console.log('Navigate back twice. Breadcrumb: ' + breadcrumb);

bcm.add('5');
console.log('Visit a new path and add: 5');
console.log('Breadcrumbs list: ' + bcm._breadcrumbs);

breadcrumb = bcm.prev();
console.log('Navigate back once. Breadcrumb: ' + breadcrumb);

breadcrumb = bcm.next();
console.log('Navigate forward once. Breadcrumb: ' + breadcrumb);
breadcrumb = bcm.next();
console.log('Navigate forward once. Breadcrumb: ' + breadcrumb);

var contains = bcm.contains('1');
console.log('Check history for 1. Breadcrumb found: ' + contains);

console.log('Add 8 breadcrumbs to breach the set limit of 5.');
bcm.add('6');
bcm.add('7');
bcm.add('8');
bcm.add('9');
bcm.add('10');
bcm.add('11');
bcm.add('12');
bcm.add('13');
console.log('Breadcrumbs list: ' + bcm._breadcrumbs);

console.log('Clear breadcrumbs.');
bcm.clear();
  • Changed the name of the breadcrumbmanager.js to BreadcrumbManager.js. Captial file names for classes just make more sense to me so I can distiguish bundles and frameworks from single classes.
  • Change the "main" property in package.json to point to the src/EventHandler.js since node is what uses it and needs the source code for debugging. If using things like Browserify it won't matter since the minification process happens after all files are compiled into one. This is better for everyone.
  • Optimized the add method. Don't use slice.
  • Going over the limit now contains the correct amount of breadcrumbs. Previously came up one short after adding a new breadcrumb at the limit.
  • Fully tested and stable.