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

js-qs

v2.0.351

Published

OVO JS Quote and Switch

Readme

Quote & Switch Front End

A single page application, built on AngularJS

Installation

Make sure you have Node and Yarn installed, and then run

npm login
yarn login
yarn install

Note: if you have previously had a js-qs installation on your machine before, you will need to clear your NPM and Yarn cache before running the commands above. You can do so by running:

npm cache clear
yarn cache clear

If you are getting permission errors when trying to pull private packages (i.e. ovo-bootstrap), run the following command:

npm config set always-auth true

If you are loggen in, set the always-auth to true and still getting permission errors try removing the registry setting from your .npmrc file

Project Dependencies

The project uses Yarn to manage dependencies. Yarn sits on top of NPM and offers advantages such as smart caching and better dependency resolution, as well as maintaining a lockfile in the root of the repository to track these dependencies. Do not make any modifications to the lockfile in any circumstance as this is automatically generated and maintained by Yarn.

To add a dependency to the project, run yarn add <dependencyName>. As an example, to add dependency foo to the project, run:

yarn add foo

To add a dev dependency, run yarn add with the --dev flag. As an example, to add dependency foo to the project as a dev dependency, run:

yarn add foo --dev

It is important to add dependencies to the project using Yarn and not NPM, otherwise the Yarn lockfile will not be updated.

Quick Start

To run the server in development mode:

yarn start

Structure

Currently this application is undergoing a refactor to use Typescript. Until that is complete the application has quite a complicated structure:

  • src contains the old Javascript source
  • test contains unit tests for this old Javascript
  • assets contains assets used by old Javascript
  • ts contains new Typescript source, with unit tests and assets

The application currently uses NPM, Grunt, Webpack, Karma and Mocha. The aim is to remove Grunt completely, and all new code in ts should have no dependency on Grunt.

This is all achieved using two separate angular modules. The old module is ovo.qs and its entry point is in src/main.js. This old module is wired together using angular for dependency injection within each JS file.

The new module is simply called qs - it depends on the first module, and its entry point is in ts/app.ts. Whilst this module still uses angular DI, we use ES6 imports/exports with Webpack for wiring.

Tests in the ovo.qs module use Karma and Jasmine (they run in a headless browser using PhantomJs) and have the format *.spec.js; tests in the qs module use Mocha directly (no browser, they run in node) and have the format *.test.ts.

There is a third module qs.demo which is used only when running this project locally, to set up canned API responses using angular multimocks. Its entry point is in ts/demo.ts and this is imported in the demo index.html. (When this application is actually deployed, the index.html file is generated dynamically by public-api-qs and this static index page is excluded from the build)

Testing

To run the tests:

yarn test

A Wallaby.js config file is available for this project. If your editor has the Wallaby plugin, you can use this config file and receive realtime feedback of your tests inside your editor.

Routing

The application uses ui-router for client side routing. The routes (or states) are configured in ts/app.states.ts and src/init/routes.js

Style guide

  • Prefer Typescript over Javascript, and use classes for services, controllers etc.
  • Folder per route in ts named using hyphen-case - files inside should be named using UpperCamelCase
  • API calls should be encapsulated in ts/common/clients - these should be stateless and logicless ideally
  • Common business logic should go in ts/common/services and these classes may be stateful
  • Common directives should go in ts/common/components
  • Document common directives in the wiki
  • Use controllerAs (name it ctrl) where possible in directives, and avoid $scope
  • Keep the angular global object away from classes - DI construction should happen in ts/app.ts only

Contributing to the project

All code contributed to the project should be submitted via PR. We have a PR template that should be filled out for everything that is applicable (i.e. some changes won't have applicable screenshots, but some will).